会员卡导出优化,热门商品接口增加vip金额字段,移动端订单管理处理数据不统一问题

This commit is contained in:
evoxwht 2023-03-24 15:18:39 +08:00
parent 5364f2d229
commit 705dcbe494
3 changed files with 11 additions and 5 deletions

View File

@ -495,7 +495,7 @@ class StoreOrderDao extends BaseDao
*/
public function chartTimePrice($start, $stop)
{
return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
->where('add_time', '>=', $start)
->where('add_time', '<', $stop)
->field('sum(pay_price) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')
@ -511,7 +511,7 @@ class StoreOrderDao extends BaseDao
*/
public function chartTimeNumber($start, $stop)
{
return $this->search(['is_del' => 0, 'paid' => 1, 'refund_status' => 0])
return $this->search(['pid' => 0, 'is_del' => 0, 'paid' => 1, 'refund_status' => [0, 3]])
->where('add_time', '>=', $start)
->where('add_time', '<', $stop)
->field('count(id) as num,FROM_UNIXTIME(add_time, \'%Y-%m-%d\') as time')

View File

@ -336,13 +336,19 @@ class ExportServices extends BaseServices
$filename = $data['title'] . '批次列表_' . date('YmdHis', time());
$export = $fileKey = [];
if (!empty($data['data'])) {
$userIds = array_column($data['data']->toArray(), 'use_uid');
/** @var UserServices $userService */
$userService = app()->make(UserServices::class);
$userList = $userService->getColumn([['uid', 'in', $userIds]], 'nickname,phone,real_name', 'uid');
$i = 0;
foreach ($data['data'] as $item) {
$one_data = [
'card_number' => $item['card_number'],
'card_password' => $item['card_password'],
'user_name' => $item['user_name'],
'user_phone' => $item['user_phone'],
'user_name' => $userList[$item['use_uid']]['real_name'] ?: $userList[$item['use_uid']]['nickname'],
'user_phone' => $userList[$item['use_uid']] ? $userList[$item['use_uid']]['phone'] : "",
'use_time' => $item['use_time'],
'use_uid' => $item['use_uid'] ? '已领取' : '未领取'
];

View File

@ -1259,7 +1259,7 @@ class StoreProductServices extends BaseServices
$page = 1;
$limit = $num;
}
$list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale']);
$list = $this->dao->getSearchList($where, $page, $limit, ['id,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,unit_name,presale,is_vip,vip_price']);
$list = $this->getActivityList($list);
return $list;
}