// +---------------------------------------------------------------------- declare (strict_types = 1); namespace app\store\controller; use app\store\model\Setting as SettingModel; use app\store\model\ApplySeller as ApplyModel; /** * 申请分销员 * Class Setting * @package app\store\controller */ class ApplySeller extends Controller { /** * 申请列表 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function list() { $cs = request()->get(); $m = new ApplyModel(); $list = $m->getList($cs); return $this->renderSuccess(compact('list')); } /** * 更新分销员状态 * @return array */ public function update() { // 保存商城设置 $model = new ApplyModel(); if ($model->edit( $this->postForm())) { return $this->renderSuccess('操作成功'); } return $this->renderError($model->getError() ?: '操作失败'); } // public function upperuser(){ $list = ApplyModel::where("user_id",'>',0)->paginate(15)->each(function($item){ // if(strlen($item['mobile'])==11){ // $item['mobile'] = substr($item['mobile'],0,3).'****'.substr($item['mobile'],7); // } $item['order_cnt'] =0; $item['order_amount'] =0; }); return $this->renderSuccess(compact('list')); } }