Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
efd48e0fa7
@ -57,7 +57,7 @@ class CapitalFlowLogic extends BaseLogic
|
||||
* @param $mark
|
||||
* @return mixed
|
||||
*/
|
||||
public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0,$store_id=0,)
|
||||
public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0,$store_id=0)
|
||||
{
|
||||
$model = new CapitalFlow();
|
||||
$model->uid = $this->user['id'];
|
||||
|
@ -309,19 +309,21 @@ class PayNotifyLogic extends BaseLogic
|
||||
{
|
||||
$financeLogic = new StoreFinanceFlowLogic();
|
||||
$user_sing = new UserSign();
|
||||
|
||||
$vipFen = 0;
|
||||
if ($order['uid'] > 0) {
|
||||
// 结算金额 要支付的钱减去冻结得钱去走后面得逻辑 发得兑换券也要去减去
|
||||
//用户下单该用户等级为1得时候才处理冻结金额
|
||||
$user = User::where('id', $order['uid'])->find();
|
||||
|
||||
//纯在分销关系的时候要去判断分销出来的用户的采购款的额度
|
||||
if ($order['spread_uid'] > 0 && $user['user_ship'] == 1) {
|
||||
$oldUser = User::where('id',$order['spread_uid'])->value('purchase_funds');
|
||||
if ($oldUser < $order['pay_price']) {
|
||||
$order['pay_price'] = $oldUser;
|
||||
//纯在分销关系的时候要去判断分销出来的用户的采购款的额度 (只有会员按照这个逻辑拆分,其余的还是按照正常的支付金额)
|
||||
if ($order['spread_uid'] > 0) {
|
||||
$oldUser = User::where('id',$order['spread_uid'])->field('purchase_funds,user_ship')->find();
|
||||
if ($oldUser && $oldUser['user_ship'] == 1){
|
||||
if ($oldUser['purchase_funds'] < $order['pay_price']) {
|
||||
$vipFen = $oldUser['purchase_funds'];
|
||||
}
|
||||
}
|
||||
}elseif ($user['user_ship'] == 1){
|
||||
}
|
||||
elseif ($user['user_ship'] == 1){
|
||||
$vipFrozenAmount = self::dealFrozenPrice($order['id']);
|
||||
//为1的时候要去减活动价
|
||||
// $final_price = bcsub($order['pay_price'],$order['deduction_price'],2);
|
||||
@ -386,7 +388,11 @@ class PayNotifyLogic extends BaseLogic
|
||||
// if ($order['is_vip'] >= 1) {
|
||||
if ($order['spread_uid'] > 0) {
|
||||
$financeLogic->other_arr['vip_uid'] = $order['spread_uid'];
|
||||
$fees = bcdiv(bcmul($order['pay_price'], '0.08', 2), 1, 2);
|
||||
if($vipFen){
|
||||
$fees = bcdiv(bcmul($vipFen, '0.08', 2), 1, 2);
|
||||
}else{
|
||||
$fees = bcdiv(bcmul($order['pay_price'], '0.08', 2), 1, 2);
|
||||
}
|
||||
$count_frees = bcadd($count_frees, $fees, 2);
|
||||
if ($fees > 0) {
|
||||
User::where('id', $order['spread_uid'])->inc('now_money', $fees)->update();
|
||||
|
@ -112,8 +112,10 @@ class StoreOrderLogic extends BaseLogic
|
||||
}
|
||||
if ($user && $user['user_ship'] == 1) {
|
||||
$pay_price = self::$pay_price;
|
||||
$activity_string = '';
|
||||
}else{
|
||||
$pay_price =bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额
|
||||
$activity_string = '减免';
|
||||
}
|
||||
|
||||
$vipPrice = 0;
|
||||
@ -132,7 +134,7 @@ class StoreOrderLogic extends BaseLogic
|
||||
'cart_id' => implode(',', $cartId),
|
||||
'store_id' => $params['store_id'] ?? 0,
|
||||
'shipping_type' =>3,//配送方式 1=快递 ,2=门店自提
|
||||
'activity' =>'减免',
|
||||
'activity' =>$activity_string,
|
||||
'activity_price' =>self::$activity_price,//活动优惠价
|
||||
'activities' => self::$activity_price>0?1:0,
|
||||
'default_delivery'=>1,
|
||||
|
@ -46,13 +46,13 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$store_id = $this->adminInfo['store_id'];
|
||||
$store_id = $this->adminInfo['store_id']??5;
|
||||
$this->searchWhere[] = ['store_id' ,'=',$store_id];
|
||||
$is_sashier=$this->request->get('is_sashier');
|
||||
if($is_sashier==1){//收银台订单
|
||||
$this->searchWhere[] = ['pay_type','in',[17,9,13]];
|
||||
$this->searchWhere[] = ['pay_type','in',[17,9,13,18]];
|
||||
}elseif($is_sashier==2){//小程序订单
|
||||
$this->searchWhere[] = ['pay_type','in',[7,3]];
|
||||
$this->searchWhere[] = ['pay_type','in',[7,3,18]];
|
||||
}
|
||||
return StoreOrder::where($this->searchWhere)
|
||||
->field(['id', 'order_id', 'pay_price', 'pay_time', 'pay_type', 'status','paid'])
|
||||
|
Loading…
x
Reference in New Issue
Block a user