feat(store): 添加用户地址功能
This commit is contained in:
parent
2b364dfa62
commit
f9f39c2ac0
@ -14,6 +14,7 @@ use app\common\logic\PaymentLogic;
|
|||||||
use app\common\logic\PayNotifyLogic;
|
use app\common\logic\PayNotifyLogic;
|
||||||
use app\common\model\Config;
|
use app\common\model\Config;
|
||||||
use app\common\model\user\User;
|
use app\common\model\user\User;
|
||||||
|
use app\common\model\user\UserAddress;
|
||||||
use app\common\model\user_create_log\UserCreateLog;
|
use app\common\model\user_create_log\UserCreateLog;
|
||||||
use app\common\model\user_recharge\UserRecharge;
|
use app\common\model\user_recharge\UserRecharge;
|
||||||
use support\Cache;
|
use support\Cache;
|
||||||
@ -91,6 +92,24 @@ class StoreController extends BaseApiController
|
|||||||
$find['real_name']=$params['real_name'];
|
$find['real_name']=$params['real_name'];
|
||||||
$find['label_id']=$params['label_id']??0;
|
$find['label_id']=$params['label_id']??0;
|
||||||
$find->save();
|
$find->save();
|
||||||
|
$adds=UserAddress::where('uid',$find['id'])->find();
|
||||||
|
$adds_data=[
|
||||||
|
'uid' => $find['id'],
|
||||||
|
'real_name' => $params['real_name']??"",
|
||||||
|
'mobile' => $params['mobile']??'',
|
||||||
|
'province' => $params['province']??'',
|
||||||
|
'city' => $params['city']??'',
|
||||||
|
'area' => $params['area']??'',
|
||||||
|
'street' => $params['street']??'',
|
||||||
|
'village' => $params['village']??'',
|
||||||
|
'brigade' => $params['brigade']??'',
|
||||||
|
'is_default' => 1,
|
||||||
|
];
|
||||||
|
if($adds){
|
||||||
|
$adds->save($adds_data);
|
||||||
|
}else{
|
||||||
|
UserAddress::create($adds_data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if($recharge_type!='INDUSTRYMEMBERS'){
|
if($recharge_type!='INDUSTRYMEMBERS'){
|
||||||
return $this->success('添加用户成功');
|
return $this->success('添加用户成功');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user