mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 06:20:50 +00:00
秒杀相关问题修复
This commit is contained in:
parent
ffe93cd369
commit
4961dca45f
@ -151,7 +151,7 @@ class StoreSeckill extends AuthController
|
||||
public function seckillPeople($id)
|
||||
{
|
||||
[$keyword] = $this->request->getMore([
|
||||
['keyword', '']
|
||||
['real_name', '', '', 'keyword']
|
||||
], true);
|
||||
return app('json')->success($this->services->seckillPeople($id, $keyword));
|
||||
}
|
||||
|
||||
@ -894,7 +894,7 @@ class StoreOrderDao extends BaseDao
|
||||
*/
|
||||
public function seckillPeople($id, $keyword, $page = 0, $limit = 0)
|
||||
{
|
||||
return $this->getModel()
|
||||
return $this->getModel()->where('paid', 1)->whereIn('refund_type', [0, 3])
|
||||
->when($id != 0, function ($query) use ($id) {
|
||||
$query->where('seckill_id', $id);
|
||||
})->when($keyword != '', function ($query) use ($keyword) {
|
||||
@ -902,6 +902,7 @@ class StoreOrderDao extends BaseDao
|
||||
})->where('paid', 1)->field([
|
||||
'real_name',
|
||||
'uid',
|
||||
'user_phone',
|
||||
'SUM(total_num) as goods_num',
|
||||
'COUNT(id) as order_num',
|
||||
'SUM(pay_price) as total_price',
|
||||
|
||||
@ -362,7 +362,7 @@ class StoreSeckillServices extends BaseServices
|
||||
$header[] = ['title' => $item['value'], 'key' => 'value' . ($key + 1), 'align' => 'center', 'minWidth' => 80];
|
||||
}
|
||||
$header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
|
||||
$header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
|
||||
$header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
|
||||
$header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
|
||||
$header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
|
||||
$header[] = ['title' => '库存', 'key' => 'stock', 'align' => 'center', 'minWidth' => 80];
|
||||
@ -732,7 +732,7 @@ class StoreSeckillServices extends BaseServices
|
||||
$orderServices = app()->make(StoreOrderServices::class);
|
||||
$pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1]], 'uid', false);
|
||||
$order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id]], 'uid', false);
|
||||
$all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'pay_price');
|
||||
$all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]], ['paid', '=', 1]], 'pay_price');
|
||||
$seckillInfo = $this->dao->get($id);
|
||||
$pay_rate = $seckillInfo['quota'] . '/' . $seckillInfo['quota_show'];
|
||||
return compact('pay_count', 'order_count', 'all_price', 'pay_rate');
|
||||
|
||||
@ -950,7 +950,7 @@ class StoreProductServices extends BaseServices
|
||||
}
|
||||
$header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
|
||||
if ($type == 1) {
|
||||
$header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
|
||||
$header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
|
||||
$header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
|
||||
$header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
|
||||
} elseif ($type == 2) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user