diff --git a/app/api/controller/user/AddressController.php b/app/api/controller/user/AddressController.php index 6069d496..1fbe2bf5 100644 --- a/app/api/controller/user/AddressController.php +++ b/app/api/controller/user/AddressController.php @@ -6,18 +6,16 @@ use app\api\controller\BaseApiController; use app\api\lists\user\UserAddressList; use app\api\logic\user\AddressLogic; use app\api\validate\UserAddressValidate; -use app\common\model\retail\Cashierclass; class AddressController extends BaseApiController { public function lists(){ return $this->dataLists(new UserAddressList()); } + /** - * @notes 添加地址 - * @return \think\response\Json - * @author likeadmin - * @date 2024/4/24 10:37 + * 添加地址 + * @return \support\Response */ public function create() { @@ -33,7 +31,7 @@ class AddressController extends BaseApiController /** * 商户给用户添加地址 */ - public function merchant_create() + /* public function merchant_create() { $params = $this->request->post(); if($params['order_id'] && $params['order_id']!=0){ @@ -47,13 +45,13 @@ class AddressController extends BaseApiController if(AddressLogic::hasError()){ return $this->fail(AddressLogic::getError()); }else{ -// Cashierclass::where('id',$params['order_id'])->update(['address_id'=>$res,'real_name'=>$params['real_name'],'user_phone'=>$params['phone'],'user_address'=>$params['detail']]); + Cashierclass::where('id',$params['order_id'])->update(['address_id'=>$res,'real_name'=>$params['real_name'],'user_phone'=>$params['phone'],'user_address'=>$params['detail']]); return $this->success('添加成功'); } - } + }*/ /** * @notes 编辑地址 - * @return \think\response\Json + * @return \support\Response * @author likeadmin * @date 2024/4/24 10:37 */ @@ -71,7 +69,7 @@ class AddressController extends BaseApiController /** * @notes 删除地址 - * @return \think\response\Json + * @return \support\Response * @author likeadmin * @date 2024/4/24 10:37 */ @@ -87,7 +85,7 @@ class AddressController extends BaseApiController /** * @notes 获取地址详情 - * @return \think\response\Json + * @return \support\Response * @author likeadmin * @date 2024/4/24 10:37 */ diff --git a/app/api/controller/user/UserFeedbackController.php b/app/api/controller/user/UserFeedbackController.php index e65ecabd..5a954c94 100644 --- a/app/api/controller/user/UserFeedbackController.php +++ b/app/api/controller/user/UserFeedbackController.php @@ -12,7 +12,7 @@ /** * @notes 获取用户反馈表列表 - * @return \think\response\Json + * @return \support\Response * @author likeadmin * @date 2024/05/13 16:56 */ diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index a4c90bef..a697e8d1 100644 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -16,6 +16,7 @@ namespace app\api\logic; use app\common\cache\WebScanLoginCache; use app\common\logic\BaseLogic; +use app\common\model\system_store\SystemStoreStaff; use app\api\service\{UserTokenService, WechatUserService}; use app\common\enum\{LoginEnum, user\UserTerminalEnum, YesNoEnum}; use app\common\service\{ @@ -229,6 +230,16 @@ class LoginLogic extends BaseLogic // 更新登录信息 self::updateLoginInfo($userInfo['id']); + //判断是不是员工 + $userInfo['is_staff'] = 0; + $userInfo['store_id'] = 0; + if($userInfo['mobile']){ + $check = SystemStoreStaff::where('phone',$userInfo['mobile'])->find()??[]; + if ($check){ + $userInfo['is_staff'] = 1; + $userInfo['store_id'] = $check['store_id']; + } + } Db::commit(); return $userInfo; diff --git a/app/common/model/system_store/SystemStoreStaff.php b/app/common/model/system_store/SystemStoreStaff.php new file mode 100644 index 00000000..277418c4 --- /dev/null +++ b/app/common/model/system_store/SystemStoreStaff.php @@ -0,0 +1,22 @@ +