ElectronicsOrder.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace app\admin\controller\shop;
  3. use app\common\controller\Backend;
  4. /**
  5. * 电子面单
  6. *
  7. * @icon fa fa-circle-o
  8. */
  9. class ElectronicsOrder extends Backend
  10. {
  11. /**
  12. * ElectronicsOrder模型对象
  13. * @var \app\admin\model\shop\ElectronicsOrder
  14. */
  15. protected $model = null;
  16. public function _initialize()
  17. {
  18. parent::_initialize();
  19. $this->model = new \app\admin\model\shop\ElectronicsOrder;
  20. $this->view->assign("paytypeList", $this->model->getPaytypeList());
  21. $this->view->assign("isNoticeList", $this->model->getIsNoticeList());
  22. $this->view->assign("isReturnTempList", $this->model->getIsReturnTempList());
  23. $this->view->assign("isSendMessageList", $this->model->getIsSendMessageList());
  24. $this->view->assign("isReturnSignBillList", $this->model->getIsReturnSignBillList());
  25. $this->view->assign("expTypeList", $this->model->getExpTypeList());
  26. }
  27. /**
  28. * 查看
  29. */
  30. public function index()
  31. {
  32. //设置过滤方法
  33. $this->request->filter(['strip_tags', 'trim']);
  34. if ($this->request->isAjax()) {
  35. //如果发送的来源是Selectpage,则转发到Selectpage
  36. if ($this->request->request('keyField')) {
  37. return $this->selectpage();
  38. }
  39. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  40. $list = $this->model
  41. ->with(['Shipper'])
  42. ->where($where)
  43. ->order($sort, $order)
  44. ->paginate($limit);
  45. $result = array("total" => $list->total(), "rows" => $list->items());
  46. return json($result);
  47. }
  48. return $this->view->fetch();
  49. }
  50. }