| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\admin\controller\product;
- use app\common\controller\Backend;
- /**
- * 寄售求购
- *
- * @icon fa fa-circle-o
- */
- class Buying extends Backend
- {
- /**
- * Buying模型对象
- * @var \app\admin\model\product\Buying
- */
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\common\model\ProductBuying();
- }
- public function index()
- {
- //设置过滤方法
- $this->request->filter(['strip_tags', 'trim']);
- if (false === $this->request->isAjax()) {
- return $this->view->fetch();
- }
- //如果发送的来源是 Selectpage,则转发到 Selectpage
- if ($this->request->request('keyField')) {
- return $this->selectpage();
- }
- [$where, $sort, $order, $offset, $limit] = $this->buildparams();
- $ids = $this->request->param('ids');
- $list = $this->model->with('users,productlists')
- ->where($where)
- //->where('synthesis_id', '=', $ids)
- ->order($sort, $order)
- ->paginate($limit);
- $result = ['total' => $list->total(), 'rows' => $list->items()];
- return json($result);
- }
- }
|