地址和用户反馈

This commit is contained in:
liu 2024-06-01 15:44:56 +08:00
parent fc9eff478e
commit 2d3a4367ae
4 changed files with 43 additions and 12 deletions

View File

@ -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
*/

View File

@ -12,7 +12,7 @@
/**
* @notes 获取用户反馈表列表
* @return \think\response\Json
* @return \support\Response
* @author likeadmin
* @date 2024/05/13 16:56
*/

View File

@ -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;

View File

@ -0,0 +1,22 @@
<?php
namespace app\common\model\system_store;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 门店列表模型
* Class SystemStore
* @package app\common\model\system_store
*/
class SystemStoreStaff extends BaseModel
{
use SoftDelete;
protected $name = 'system_store_staff';
protected $deleteTime = 'delete_time';
}