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