Apply.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\store\controller\apps\dealer;
  3. use app\store\controller\Controller;
  4. use app\store\model\dealer\Apply as ApplyModel;
  5. /**
  6. * 分销商申请
  7. * Class Setting
  8. * @package app\store\controller\apps\dealer
  9. */
  10. class Apply extends Controller
  11. {
  12. /**
  13. * 分销商申请列表
  14. * @param string $search
  15. * @return mixed
  16. * @throws \think\exception\DbException
  17. */
  18. public function index($search = '')
  19. {
  20. $model = new ApplyModel;
  21. return $this->fetch('index', [
  22. 'list' => $model->getList($search),
  23. ]);
  24. }
  25. /**
  26. * 分销商审核
  27. * @param $apply_id
  28. * @return array
  29. * @throws \app\common\exception\BaseException
  30. * @throws \think\exception\DbException
  31. * @throws \think\exception\PDOException
  32. */
  33. public function submit($apply_id)
  34. {
  35. $model = ApplyModel::detail($apply_id);
  36. if ($model->submit($this->postData('apply'))) {
  37. return $this->renderSuccess('操作成功');
  38. }
  39. return $this->renderError($model->getError() ?: '操作失败');
  40. }
  41. }