砍价和拼团统计

This commit is contained in:
evoxwht 2023-03-31 19:10:36 +08:00
parent 8456a5f935
commit c17274dc89
7 changed files with 15 additions and 7 deletions

View File

@ -104,8 +104,11 @@ class StoreBargainUserDao extends BaseDao
*/
public function bargainUserList($where, $page = 0, $limit = 0)
{
return $this->search($where)->with(['getBargain', 'getUser'])->when($page != 0, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->order('add_time desc')->select()->toArray();
return $this->search($where)->with(['getBargain', 'getUser'])
->when(isset($where['real_name']) && $where['real_name'] != '', function ($query) use ($where) {
$query->where('uid|nickname', 'like', '%' . $where['keyword'] . '%');
})->when($page != 0, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->order('add_time desc')->select()->toArray();
}
}

View File

@ -951,7 +951,7 @@ class StoreOrderDao extends BaseDao
return $this->search($where)->where('bargain_id', $id)
->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->field(['order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->select()->toArray();
})->field(['uid', 'order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->select()->toArray();
}
/**
@ -967,7 +967,7 @@ class StoreOrderDao extends BaseDao
*/
public function combinationStatisticsOrder($id, $where, $page = 0, $limit = 0)
{
return $this->search($where)->where('combination_id', $id)->where('paid', 1)->whereIn('refund_type', [0, 3])->where('is_del', 0)
return $this->search($where)->where('combination_id', $id)
->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})->field(['uid', 'order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->order('add_time desc')->select()->toArray();

View File

@ -1027,6 +1027,7 @@ class StoreBargainServices extends BaseServices
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);
[$page, $limit] = $this->getPageValue();
$where = $where + ['paid' => 1, 'refund_status' => 0, 'is_del' => 0];
$list = $orderServices->bargainStatisticsOrder($id, $where, $page, $limit);
$where['bargain_id'] = $id;
$count = $orderServices->count($where);

View File

@ -234,6 +234,9 @@ class StoreBargainUserServices extends BaseServices
* 砍价列表
* @param $where
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function bargainUserList($where)
{

View File

@ -659,6 +659,7 @@ class StoreCombinationServices extends BaseServices
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);
[$page, $limit] = $this->getPageValue();
$where = $where + ['paid' => 1, 'refund_status' => 0, 'is_del' => 0];
$list = $orderServices->combinationStatisticsOrder($id, $where, $page, $limit);
$where['combination_id'] = $id;
$count = $orderServices->count($where);

View File

@ -775,7 +775,7 @@ class StoreSeckillServices extends BaseServices
/** @var StoreOrderServices $orderServices */
$orderServices = app()->make(StoreOrderServices::class);
[$page, $limit] = $this->getPageValue();
$where['is_del'] = 0;
$where = $where + ['paid' => 1, 'refund_status' => 0, 'is_del' => 0];
$list = $orderServices->seckillOrder($id, $where, $page, $limit);
$where['seckill_id'] = $id;
$count = $orderServices->count($where);

View File

@ -42,7 +42,7 @@
search
enter-button
v-model="pagination.real_name"
placeholder="请输入用户姓名|手机号|UID"
:placeholder="type == 1 ? '请输入用户姓名|订单号|UID' : '请输入用户UID'"
@on-search="searchList"
/>
</FormItem>