Merge branch 'dev' of https://gitea.lihaink.cn/mkm/shop-new into dev
# Conflicts: # app/common/repositories/store/order/StoreOrderRepository.php
This commit is contained in:
commit
cf1a38ea0f
@ -200,7 +200,12 @@ class UserBillDao extends BaseDao
|
|||||||
return UserBill::getDB()
|
return UserBill::getDB()
|
||||||
->when(isset($where['now_money']) && in_array($where['now_money'], [0, 1, 2]), function ($query) use ($where) {
|
->when(isset($where['now_money']) && in_array($where['now_money'], [0, 1, 2]), function ($query) use ($where) {
|
||||||
if ($where['now_money'] == 0)
|
if ($where['now_money'] == 0)
|
||||||
$query->where('category', 'now_money')->whereIn('type', ['pay_product', 'recharge', 'sys_inc_money', 'sys_dec_money', 'brokerage', 'presell', 'refund']);
|
$query->whereIn('type', ['pay_product', 'recharge', 'sys_inc_money', 'sys_dec_money', 'brokerage', 'presell', 'refund', 'zhibo_reward_inc', 'zhibo_reward_dec','order_one'])
|
||||||
|
->where(function ($query) {
|
||||||
|
$query->where('category', 'now_money')
|
||||||
|
->whereOr('category', 'brokerage');
|
||||||
|
});
|
||||||
|
|
||||||
else if ($where['now_money'] == 1)
|
else if ($where['now_money'] == 1)
|
||||||
$query->where('category', 'now_money')->whereIn('type', ['pay_product', 'sys_dec_money', 'presell']);
|
$query->where('category', 'now_money')->whereIn('type', ['pay_product', 'sys_dec_money', 'presell']);
|
||||||
else if ($where['now_money'] == 2)
|
else if ($where['now_money'] == 2)
|
||||||
|
@ -2682,20 +2682,17 @@ class StoreOrderRepository extends BaseRepository
|
|||||||
$deal = $this->dealArr($list);
|
$deal = $this->dealArr($list);
|
||||||
//平均2个左右 0 1 2 阶梯往上查寻找
|
//平均2个左右 0 1 2 阶梯往上查寻找
|
||||||
[$products, $minNum] = $this->getRange($deal, $range);
|
[$products, $minNum] = $this->getRange($deal, $range);
|
||||||
$result = [];
|
$list = [];
|
||||||
if (!empty($products)) {
|
if (!empty($products)) {
|
||||||
$result = $this->findNearestPriceProduct($products, $money, $minNum);
|
$list = $this->findNearestPriceProduct($products, $money, $minNum);
|
||||||
|
}
|
||||||
|
$count = count($list);//计算数量的
|
||||||
}
|
}
|
||||||
$count = count($result);//计算数量的
|
|
||||||
return [
|
return [
|
||||||
'count' => $count,
|
'count' => $count,
|
||||||
'list' => $result,
|
'list' => $list,
|
||||||
'merInfo' => $merInfo,
|
'merInfo' => $merInfo,
|
||||||
];
|
];
|
||||||
|
|
||||||
} else {
|
|
||||||
return compact('count', 'list','merInfo');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRange($array, $range)
|
public function getRange($array, $range)
|
||||||
|
@ -332,8 +332,6 @@ class StoreOrder extends BaseController
|
|||||||
return app('json')->success($this->repository->beginMerchant($merId));
|
return app('json')->success($this->repository->beginMerchant($merId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$where = [
|
$where = [
|
||||||
"a.mer_id" => $merId,
|
"a.mer_id" => $merId,
|
||||||
"p.is_show" => 1,
|
"p.is_show" => 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user