model = new \app\agent\model\order\Goods(); } public function index() { $user = $this->auth->user(); $where[] = ['area_id', 'eq', $user['area_id']]; //组合搜索 !empty(input('name')) && $where[] = ['name', 'like', '%' . input('name') . '%']; (!empty(input('pin')) || input('pin') == '0') && $where[] = ['is_pin', 'eq', input('pin')]; (!empty(input('status')) || input('status') == '0') && $where[] = ['status', 'eq', input('status')]; !empty(input('area')) && $where[] = ['area_id', 'eq', input('area')]; !empty(input('keywords')) && $where[] = ['user_id|order_no', 'like', '%' . input('keywords') . '%']; // 时间处理 if (!empty(input('created_at'))){ list($start, $end) = str2arr(input('created_at'),'-'); $where[] = ['created_at', 'between', [strtotime($start), strtotime($end)]]; } return IResponse::paginate($this->model->where($where)->with(['user','seller','addr']) ->order(['created_at' => 'desc']) ->paginate(input('limit'),false)); } }