Skillensurepay.php 1.5 KB

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