123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\admin\controller;
- use app\admin\model\LiveRoomGoodsModel;
- use app\common\model\UserModel;
- use App\Utils\AppResult;
- use think\Request;
- /**
- * Admin 模块父级
- * Module 接管 CURD 公共操作
- * Class ModuleController
- * @package App\Http\Controllers\Framework
- */
- class LiveRoomGoods extends VueModule
- {
- public function callAction($method, $parameters = [])
- {
- // 获取请求参数 用于二次处理
- $params = $this->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);
- }
- }
|