SendLog.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://demo.thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  12. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  13. // +----------------------------------------------------------------------
  14. namespace app\store\controller;
  15. use library\Controller;
  16. use library\tools\Data;
  17. use think\Db;
  18. /**
  19. * 指派记录
  20. * Class GoodsCate
  21. * @package app\store\controller
  22. */
  23. class SendLog extends Controller
  24. {
  25. /**
  26. * 绑定数据表
  27. * @var string
  28. */
  29. protected $table = 'store_send_log';
  30. /**
  31. * 指派记录管理
  32. * @auth true
  33. * @menu true
  34. * @throws \think\Exception
  35. * @throws \think\db\exception\DataNotFoundException
  36. * @throws \think\db\exception\ModelNotFoundException
  37. * @throws \think\exception\DbException
  38. * @throws \think\exception\PDOException
  39. */
  40. public function index()
  41. {
  42. $this->title = '指派记录管理';
  43. $query = $this->_query($this->table);
  44. $where[] = ['a.id','>',0];
  45. if($this->request->request('order_no')){
  46. $where[]=['a.order_no','like','%'.$this->request->request('order_no').'%'];
  47. }
  48. $query
  49. ->alias('a')
  50. ->field('a.*,m.phone,m.name')
  51. ->join('store_engineer m','a.worker_id = m.id')
  52. ->where($where)
  53. ->order('a.id desc')
  54. ->page();
  55. }
  56. /**需求列表处理
  57. * @param array $data
  58. * @throws \think\db\exception\DataNotFoundException
  59. * @throws \think\db\exception\ModelNotFoundException
  60. * @throws \think\exception\DbException
  61. */
  62. protected function _index_page_filter(array &$data)
  63. {
  64. foreach ($data as &$vo) {
  65. $vo['worker'] = Db::name('store_engineer')->field('headimg,name,phone')->where('id',$vo['worker_id'])->find();
  66. $vo['send_worker'] = Db::name('store_engineer')->field('headimg,name,phone')->where('id',$vo['send_worker_id'])->find();
  67. }
  68. }
  69. }