Mission.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\agent\controller\order;
  3. use app\common\controller\AgentController;
  4. use app\http\IResponse;
  5. use Lettered\Support\Auth as IAuth;
  6. use think\App;
  7. class Mission extends AgentController
  8. {
  9. protected $model;
  10. /**
  11. * Mission constructor.
  12. * @param App|null $app
  13. * @param IAuth $auth
  14. */
  15. public function __construct(App $app = null, IAuth $auth)
  16. {
  17. parent::__construct($app, $auth);
  18. $this->model = new \app\agent\model\order\Mission();
  19. }
  20. /**
  21. * @desc desc
  22. * @return mixed
  23. * @throws \Lettered\Support\Exceptions\FailedException
  24. * @throws \think\exception\DbException
  25. * @author weichuanbao<654745815@qq.com>
  26. * @date 2021/12/10 0010
  27. */
  28. public function index()
  29. {
  30. $where[] = ['area_id', 'eq', $this->auth->user()->area_id];
  31. return IResponse::paginate($this->model->where($where)->with(['mission','user','service'])->order(['created_at' => 'desc'])
  32. ->paginate(input('limit'),false));
  33. }
  34. }