Vipinfo.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace app\controller\admin;
  3. use laytp\controller\Backend;
  4. use think\facade\Config;
  5. use laytp\library\CommonFun;
  6. /**
  7. * 订单
  8. */
  9. class Vipinfo extends Backend
  10. {
  11. /**
  12. * order模型对象
  13. * @var \app\model\Order
  14. */
  15. protected $model;
  16. protected $hasSoftDel=0;//是否拥有软删除功能
  17. protected $noNeedLogin = []; // 无需登录即可请求的方法
  18. protected $noNeedAuth = ['index', 'info']; // 无需鉴权即可请求的方法
  19. public function _initialize()
  20. {
  21. $this->model = new \app\model\Vipinfo();
  22. }
  23. //查看和搜索列表
  24. public function index(){
  25. global $_W;
  26. $where = $this->buildSearchParams();
  27. $where[] = ['uniacid','=',$_W['uniacid']];
  28. // $order = $this->buildOrder();
  29. $data = $this->model->where($where)->with(['memberInfo','userInfo']);
  30. $paging = $this->request->param('paging', false);
  31. if ($paging) {
  32. $limit = $this->request->param('limit', Config::get('paginate.limit'));
  33. $data = $data->paginate($limit)->toArray();
  34. $data['data'] = $this->getSelectedData($data['data']);
  35. } else {
  36. $data = $data->select()->toArray();
  37. }
  38. return $this->success('数据获取成功', $data);
  39. }
  40. //查看详情
  41. public function info()
  42. {
  43. $id = $this->request->param('id');
  44. $info = $this->model->find($id);
  45. return $this->success('获取成功', $info);
  46. }
  47. }