ソースを参照

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

evoxwht 2 年 前
コミット
705dcbe494

+ 2 - 2
crmeb/app/dao/order/StoreOrderDao.php

@@ -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')

+ 8 - 2
crmeb/app/services/other/export/ExportServices.php

@@ -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'] ? '已领取' : '未领取'
                 ];

+ 1 - 1
crmeb/app/services/product/product/StoreProductServices.php

@@ -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;
     }