Shopensurepay.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\admin\controller\service\money;
  3. use app\common\controller\Backend;
  4. /**
  5. * 商家保证金支付管理
  6. *
  7. * @icon fa fa-circle-o
  8. */
  9. class Shopensurepay extends Backend
  10. {
  11. /**
  12. * Shopensurepay模型对象
  13. * @var \app\admin\model\service\money\Shopensurepay
  14. */
  15. protected $model = null;
  16. public function _initialize()
  17. {
  18. parent::_initialize();
  19. $this->model = new \app\admin\model\service\money\Shopensurepay;
  20. $this->view->assign("paytypeList", $this->model->getPaytypeList());
  21. $this->view->assign("stateList", $this->model->getStateList());
  22. }
  23. public function index()
  24. {
  25. //设置过滤方法
  26. $this->request->filter(['strip_tags', 'trim']);
  27. if (false === $this->request->isAjax()) {
  28. return $this->view->fetch();
  29. }
  30. //如果发送的来源是 Selectpage,则转发到 Selectpage
  31. if ($this->request->request('keyField')) {
  32. return $this->selectpage();
  33. }
  34. [$where, $sort, $order, $offset, $limit] = $this->buildparams();
  35. $list = $this->model
  36. ->where($where)
  37. ->where('state',1)
  38. ->order($sort, $order)
  39. ->paginate($limit);
  40. foreach ($list as &$value)
  41. {
  42. $value->shop = \app\admin\model\service\shop\Shop::where('user_id',$value->user_id)->field('id,leader_name,leader_mobile')->find();
  43. }
  44. $result = ['total' => $list->total(), 'rows' => $list->items()];
  45. return json($result);
  46. }
  47. }