50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
|
|
namespace app\store\controller\user;
|
|
|
|
|
|
use app\store\controller\BaseAdminController;
|
|
use app\store\lists\user\UserLists;
|
|
use app\admin\logic\user\UserLogic;
|
|
use app\admin\validate\user\UserValidate;
|
|
use app\common\model\user\User;
|
|
|
|
class UserController extends BaseAdminController
|
|
{
|
|
|
|
public function lists()
|
|
{
|
|
return $this->dataLists(new UserLists());
|
|
}
|
|
|
|
|
|
public function add()
|
|
{
|
|
$params = (new UserValidate())->post()->goCheck('storeAdd');
|
|
UserLogic::StoreAdd($params);
|
|
if (UserLogic::hasError() ) {
|
|
return $this->fail(UserLogic::getError());
|
|
}
|
|
return $this->success('添加成功', [], 1, 1);
|
|
|
|
}
|
|
|
|
public function detail()
|
|
{
|
|
$params = (new UserValidate())->goCheck('detail');
|
|
$detail = UserLogic::detail($params['id']);
|
|
return $this->success('', $detail);
|
|
}
|
|
|
|
public function user_ship(){
|
|
$user_ship=$this->request->post('user_ship',0);
|
|
$id=$this->request->post('id',0);
|
|
if($user_ship==1){
|
|
return $this->fail('充值会员不能前端设置');
|
|
}
|
|
User::where('id',$id)->update(['user_ship'=>$user_ship]);
|
|
return $this->success('设置成功');
|
|
}
|
|
|
|
} |