uplogmodel.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: sicilon_IT
  5. * Date: 2021/5/6
  6. * Time: 20:34
  7. */
  8. namespace app\index\model;
  9. use think\Model;
  10. class uplogmodel extends Model{
  11. protected $table='t_uplog';
  12. /*
  13. * 20210506
  14. * 插入记录
  15. */
  16. public function insinfo($arr){
  17. $this->allowField(true)->isUpdate(false)->setAttr('id',null)->save($arr);
  18. return $this->id;
  19. }
  20. /*
  21. * 20210506
  22. */
  23. public function selinfobyfname($fname){
  24. $where_arr['upfilename']=$fname;
  25. $rinfo=$this->where($where_arr)->find();
  26. return $rinfo;
  27. }
  28. /*
  29. * 20210509
  30. * 获取所有的导入记录
  31. */
  32. public function selalllist(){
  33. $rlist=$this->order('id','desc')->select();
  34. $rlist=collection($rlist)->toArray();
  35. return $rlist;
  36. }
  37. /*
  38. * 20230214
  39. *
  40. */
  41. public function sellistbycid($cid){
  42. $where_arr['companyid']=$cid;
  43. $rlist=$this->where($where_arr)->order('id','desc')->select();
  44. $rlist=collection($rlist)->toArray();
  45. return $rlist;
  46. }
  47. }