params; $this->model = new LiveRoomGoodsModel(); // 根据不同方法处理一些业务 switch ($method) { case 'index': // 请求类型是否为POST if ($this->isPost) { // 条件语句 if (!empty($params['keyword'])) { $this->model->where('nickname|mobile', 'like', "%{$params['keyword']}%"); } if (!empty($params['gender'])) $this->model->where('gender', $params['gender']); $this->model->with(['room','goods']); $this->model->order('is_top','desc'); $this->model->order('goods_no','asc'); } break; // case 'insert': // break; // case 'update': // break; default: break; } return parent::callAction($method, $parameters); // TODO: Change the autogenerated stub } public function __construct(Request $request = null) { parent::__construct($request); } }