ApplySeller.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\store\controller;
  13. use app\store\model\Setting as SettingModel;
  14. use app\store\model\ApplySeller as ApplyModel;
  15. /**
  16. * 申请分销员
  17. * Class Setting
  18. * @package app\store\controller
  19. */
  20. class ApplySeller extends Controller
  21. {
  22. /**
  23. * 申请列表
  24. * @return array
  25. * @throws \think\db\exception\DataNotFoundException
  26. * @throws \think\db\exception\DbException
  27. * @throws \think\db\exception\ModelNotFoundException
  28. */
  29. public function list()
  30. {
  31. $cs = request()->get();
  32. $m = new ApplyModel();
  33. $list = $m->getList($cs);
  34. return $this->renderSuccess(compact('list'));
  35. }
  36. /**
  37. * 更新分销员状态
  38. * @return array
  39. */
  40. public function update()
  41. {
  42. // 保存商城设置
  43. $model = new ApplyModel();
  44. if ($model->edit( $this->postForm())) {
  45. return $this->renderSuccess('操作成功');
  46. }
  47. return $this->renderError($model->getError() ?: '操作失败');
  48. }
  49. //
  50. public function upperuser(){
  51. $list = ApplyModel::where("user_id",'>',0)->paginate(15)->each(function($item){
  52. // if(strlen($item['mobile'])==11){
  53. // $item['mobile'] = substr($item['mobile'],0,3).'****'.substr($item['mobile'],7);
  54. // }
  55. $item['order_cnt'] =0;
  56. $item['order_amount'] =0;
  57. });
  58. return $this->renderSuccess(compact('list'));
  59. }
  60. }