Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
53199c8aa6
@ -76,7 +76,7 @@ class UserLogic extends BaseLogic
|
||||
}
|
||||
}
|
||||
|
||||
public static function StoreAdd(array $params)
|
||||
public static function checkAddress(array $params)
|
||||
{
|
||||
$user_ship=$params['user_ship']??0;
|
||||
if($user_ship==2){
|
||||
@ -106,6 +106,11 @@ class UserLogic extends BaseLogic
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public static function StoreAdd(array $params)
|
||||
{
|
||||
self::checkAddress($params);
|
||||
$passwordSalt = Config::get('project.unique_identification');
|
||||
$password = create_password(123456, $passwordSalt);
|
||||
$defaultAvatar = config('project.default_image.admin_avatar');
|
||||
|
@ -89,6 +89,10 @@ class StoreController extends BaseApiController
|
||||
return $this->fail(UserUserLogic::getError());
|
||||
}
|
||||
}else{
|
||||
UserUserLogic::checkAddress($params);
|
||||
if(UserUserLogic::hasError()){
|
||||
return $this->fail(UserUserLogic::getError());
|
||||
}
|
||||
$find['real_name']=$params['real_name'];
|
||||
$find['label_id']=$params['label_id']??0;
|
||||
$find->save();
|
||||
|
@ -27,25 +27,26 @@ use app\api\lists\user\UserRechargeLists;
|
||||
$send_bar = "品牌礼品券";
|
||||
$arr = [
|
||||
[
|
||||
'money'=>1000,//采购包
|
||||
// 'money'=>1000,//采购包
|
||||
'money'=>1,//采购包
|
||||
'send'=>249,//礼品券
|
||||
'money_string'=>$buy_bar,
|
||||
'send_string'=>$send_bar,
|
||||
],
|
||||
[
|
||||
'money'=>2000,//采购包
|
||||
'money'=>2,//采购包2000
|
||||
'send'=>560,//礼品券
|
||||
'money_string'=>$buy_bar,
|
||||
'send_string'=>$send_bar,
|
||||
],
|
||||
[
|
||||
'money'=>5000,//采购包
|
||||
'money'=>5,//采购包5000
|
||||
'send'=>1550,//礼品券
|
||||
'money_string'=>$buy_bar,
|
||||
'send_string'=>$send_bar,
|
||||
],
|
||||
[
|
||||
'money'=>10000,//采购包
|
||||
'money'=>10,//采购包10000
|
||||
'send'=>3500,//礼品券
|
||||
'money_string'=>$buy_bar,
|
||||
'send_string'=>$send_bar,
|
||||
|
@ -111,7 +111,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
||||
'msg' => '您已选购满500元,支付成功后即可获得'.bcmul($this->total_price,0.1,2).'元品牌礼品兑换券,可到线下门店兑换礼品。',
|
||||
'pay_price' => $this->total_price
|
||||
];
|
||||
if($this->off_activity==1){
|
||||
if($this->off_activity==0){//1
|
||||
$this->activity_price = $this->total_price;
|
||||
$data['pay_price']=$this->activity_price;
|
||||
if($this->activity_price<500){
|
||||
|
@ -116,7 +116,7 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
|
||||
}
|
||||
public function extend()
|
||||
{
|
||||
$off_activity = Config::where('name', 'off_activity')->value('value');
|
||||
// $off_activity = Config::where('name', 'off_activity')->value('value');
|
||||
// if($off_activity==1){
|
||||
// $data=[
|
||||
// 'off_activity' => $off_activity,
|
||||
@ -125,7 +125,7 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L
|
||||
// ];
|
||||
// }else{
|
||||
$data=[
|
||||
'off_activity' => $off_activity,
|
||||
'off_activity' => 0,
|
||||
'price' => 'price',
|
||||
'op_price' => 'price',
|
||||
];
|
||||
|
@ -54,6 +54,7 @@ class OrderLogic extends BaseLogic
|
||||
public static $store_price; //门店零售价
|
||||
public static $activity_price;
|
||||
public static $deduction_price;
|
||||
public static $frozen_money;//返还金额
|
||||
|
||||
/**
|
||||
* @notes 获取购物车商品信息
|
||||
@ -76,6 +77,7 @@ class OrderLogic extends BaseLogic
|
||||
self::$activity_price = 0; //活动减少
|
||||
self::$store_price = 0; //商户价
|
||||
self::$deduction_price =0;
|
||||
self::$frozen_money =0;//返还金额
|
||||
$deduction_price = 0; //抵扣金额
|
||||
/** 计算价格 */
|
||||
$off_activity = Config::where('name', 'off_activity')->value('value');
|
||||
@ -142,6 +144,7 @@ class OrderLogic extends BaseLogic
|
||||
self::$cost = bcadd(self::$cost, $cart_select[$k]['purchase'], 2);
|
||||
self::$store_price = bcadd(self::$store_price, $cart_select[$k]['store_price'], 2); //商户价
|
||||
self::$deduction_price=bcadd(self::$deduction_price,$deduction_price,2);//抵扣金额
|
||||
self::$frozen_money = bcadd(self::$frozen_money, $cart_select[$k]['vip_frozen_price'], 2);//返还金额
|
||||
// self::$profit = bcadd(self::$profit, $cart_select[$k]['profit'], 2);
|
||||
}
|
||||
//加支付方式限制
|
||||
@ -169,6 +172,7 @@ class OrderLogic extends BaseLogic
|
||||
'activity_price' => self::$activity_price,
|
||||
'activities' => self::$activity_price > 0 ? 1 : 0,
|
||||
'deduction_price' => self::$deduction_price,
|
||||
'frozen_money' => self::$frozen_money,//返还金额(活动关闭得时候有)
|
||||
'source' => 0,
|
||||
'is_storage' => $params['is_storage'] ?? 0,
|
||||
];
|
||||
|
@ -170,8 +170,10 @@ class CommissionLogic extends BaseLogic
|
||||
//记录用户余额收入
|
||||
if ($uid) {
|
||||
$GiveUser = User::where('id', $order['uid'])->find();
|
||||
$capitalFlowDao = new CapitalFlowLogic($GiveUser);
|
||||
$capitalFlowDao->userIncome('system_balance_add', 'order', $order['id'], $fees);
|
||||
if($GiveUser['user_ship'] != 5){//新限制 不为种养殖
|
||||
$capitalFlowDao = new CapitalFlowLogic($GiveUser);
|
||||
$capitalFlowDao->userIncome('system_balance_add', 'order', $order['id'], $fees);
|
||||
}
|
||||
}
|
||||
$financeLogic->user['uid'] = $order['uid'];
|
||||
$financeLogic->other_arr['vip_uid'] = $uid;
|
||||
|
@ -437,6 +437,11 @@ class PayNotifyLogic extends BaseLogic
|
||||
$order->save();
|
||||
$uid = $order->uid;
|
||||
$user = User::where('id', $uid)->findOrEmpty();
|
||||
//check store_id
|
||||
if(empty($user->store_id)){
|
||||
$user->store_id = $order['store_id'];
|
||||
}
|
||||
|
||||
//用户的财务add
|
||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||
$capitalFlowDao->userIncome('user_balance_recharge', 'user_recharge', $order['id'], $price, [], 1);
|
||||
|
@ -23,16 +23,16 @@ class UserSignLogic extends BaseLogic
|
||||
{
|
||||
$price=(int)$order['price'];
|
||||
switch ($price) {
|
||||
case 1000:
|
||||
case 1:
|
||||
$total_vip = 249;
|
||||
break;
|
||||
case 2000:
|
||||
case 2:
|
||||
$total_vip = 560;
|
||||
break;
|
||||
case 5000:
|
||||
case 5:
|
||||
$total_vip = 1550;
|
||||
break;
|
||||
case 10000:
|
||||
case 10:
|
||||
$total_vip = 3500;
|
||||
break;
|
||||
default:
|
||||
|
@ -55,7 +55,8 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists
|
||||
return $item;
|
||||
})
|
||||
->toArray();
|
||||
$off_activity = Config::where('name', 'off_activity')->value('value');
|
||||
// $off_activity = Config::where('name', 'off_activity')->value('value');
|
||||
$off_activity = 0;
|
||||
$this->off_activity = $off_activity;
|
||||
foreach ($list as $key => &$item) {
|
||||
$find = StoreBranchProduct::where(['product_id' => $item['product_id'], 'store_id' => $item['store_id']])
|
||||
|
Loading…
x
Reference in New Issue
Block a user