feat: 新增用户标签功能

This commit is contained in:
mkm 2024-06-22 16:21:46 +08:00
parent 149946b45f
commit 025134aacd
3 changed files with 28 additions and 20 deletions

View File

@ -90,6 +90,7 @@ class UserLogic extends BaseLogic
'password' => $password,
'mobile' => $params['mobile'],
'user_ship' => $params['user_ship']??0,
'label_id' => $params['label_id']??0,
];
$res=User::create($data);

View File

@ -54,6 +54,7 @@ class StoreController extends BaseApiController
{
$params = (new UserValidate())->post()->goCheck('rechargeStoreMoney');
$auth_code = $this->request->post('auth_code'); //微信支付条码
$recharge_type = $this->request->post('recharge_type',''); //微信支付条码
$find=User::where('mobile',$params['mobile'])->find();
if(!$find){
$find=UserUserLogic::StoreAdd($params);
@ -61,6 +62,9 @@ class StoreController extends BaseApiController
$find['real_name']=$params['real_name'];
$find->save();
}
if($recharge_type!='INDUSTRYMEMBERS'){
return $this->success('添加用户成功');
}
$data=[
'store_id'=>$params['store_id'],
'uid'=>$find['id'],

View File

@ -61,8 +61,9 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
->select()->each(function ($item) use ($store_id) {
if (empty($item['pay_time'])) {
$item['pay_time'] = '';
}else{
$item['pay_time'] = date('Y-m-d H:i:s', $item['pay_time']);
}
// $item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : '';
$item['pay_type_name'] = PayEnum::getPaySceneDesc($item['pay_type']) ?? '';
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
if ($item['paid'] == 0) {
@ -70,13 +71,15 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
} else {
$item['paid_name'] = '已支付';
}
$product_id = StoreOrderCartInfo::where('oid', $item['id'])->limit(3)->column('product_id');
if ($product_id) {
$item['product_info'] = StoreBranchProduct::whereIn('product_id' ,$product_id)->where('store_id', $store_id)->field(['product_id', 'store_name', 'image', 'price'])
->select();
} else {
$item['product_info'] = [];
$product = StoreOrderCartInfo::where('oid', $item['id'])->field(['id', 'oid', 'product_id', 'cart_info'])
->limit(3)->select();
foreach ($product as &$items) {
$items['store_name'] = $items['cart_info']['name'];
$items['image'] = $items['cart_info']['image'];
$items['price'] = $items['cart_info']['price'];
unset($items['cart_info']);
}
$item['product_info'] = $product;
return $item;
})
->toArray();