123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\controller\admin;
- use laytp\controller\Backend;
- use think\facade\Config;
- use laytp\library\CommonFun;
- /**
- * 会员卡
- */
- class Question extends Backend
- {
- /**
- * member模型对象
- * @var \app\model\Question
- */
- protected $model;
- protected $hasSoftDel=1;//是否拥有软删除功能
- protected $noNeedLogin = []; // 无需登录即可请求的方法
- protected $noNeedAuth = ['index']; // 无需鉴权即可请求的方法
- public function _initialize()
- {
- $this->model = new \app\model\Question();
- }
- //查看和搜索列表
- public function index(){
- global $_W;
- $where = $this->buildSearchParams();
- $where[] = ['uniacid','=',$_W['uniacid']];
- $order = $this->buildOrder();
- $data = $this->model->where($where)->order($order)->with('userInfo');
- $paging = $this->request->param('paging', false);
- if ($paging) {
- $limit = $this->request->param('limit', Config::get('paginate.limit'));
- $data = $data->paginate($limit)->toArray();
- $data['data'] = $this->getSelectedData($data['data']);
- } else {
- $data = $data->select()->toArray();
- }
- return $this->success('数据获取成功', $data);
- }
- }
|