BillHeader.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace app\synth\controller;
  3. use library\Controller;
  4. use think\Db;
  5. class BillHeader extends Controller
  6. {
  7. protected $table = 'BillHeader';
  8. /**
  9. * 列表
  10. * @auth true
  11. * @menu true
  12. * @throws \think\Exception
  13. * @throws \think\db\exception\DataNotFoundException
  14. * @throws \think\db\exception\ModelNotFoundException
  15. * @throws \think\exception\DbException
  16. * @throws \think\exception\PDOException
  17. */
  18. public function index()
  19. {
  20. $this->title = '收货地址列表';
  21. $query = $this->_query($this->table);
  22. $where= [];
  23. $were[] = ['i.is_deleted','=',0];
  24. if($this->request->request('user_name')) $where[]= ['m.name','like','%'.$this->request->request('user_name').'%'];
  25. if($this->request->request('title')) $where[]= ['i.title','like','%'.$this->request->request('title').'%'];
  26. $query->alias('i')->field('i.* ,m.headimg,m.name as user_name,m.phone')
  27. ->join('store_member m',' m.id = i.user_id ','LEFT');
  28. if(!empty($where)) $query->where($where);
  29. $query ->order('i.id desc')->page();
  30. }
  31. /**
  32. * 删除
  33. * @auth true
  34. * @menu true
  35. * @param array $data
  36. * @throws \think\db\exception\DataNotFoundException
  37. * @throws \think\db\exception\ModelNotFoundException
  38. * @throws \think\exception\DbException
  39. */
  40. public function remove()
  41. {
  42. $this->_save($this->table, ['is_deleted' => '1']);
  43. }
  44. }