ソースを参照

Merge branch 'master' into dev

shizhongqi 10 ヶ月 前
コミット
da741aca13

+ 2 - 1
app-ghs/controllers/ConsoleController.php

@@ -168,7 +168,8 @@ class ConsoleController extends BaseController
         }
 
         //$notice[] = ['title' => '节日期间官方技术服务电话2号:17189513228', 'action' => '', 'page' => ''];
-        $notice[] = ['title' => '客户下单自动计算跑腿费,快速设置', 'action' => '查看', 'page' => '/admin/book/detail?id=auto_calc_pt_fee'];
+        $notice[] = ['title' => '快速设置:客户下单自动计算跑腿费', 'action' => '查看', 'page' => '/admin/book/detail?id=auto_calc_pt_fee'];
+        $notice[] = ['title' => '订单上如何一键呼叫跑腿', 'action' => '查看', 'page' => '/admin/book/detail?id=one_call_pt'];
 
         $mainId = $this->mainId;
         $respond = StatSaleClass::profile($mainId);

+ 11 - 4
app-ghs/controllers/IntraCityController.php

@@ -61,18 +61,22 @@ class IntraCityController extends BaseController
         $adminId = $this->adminId;
         util::checkRepeatCommit($adminId, 3);
 
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : '市区';
+        $telephone = !empty($shop->telephone) ? $shop->telephone : $shop->mobile;
+
         $storeData = [
             'out_store_id' => $this->mainId, //自定义门店编号
             'store_name' => $name,
             'address_info' => [
                 'province' => $shop->province,
                 'city' => $shop->city,
-                'area' => $shop->dist,
+                'area' => $dist,
                 'street' => '',
                 'house' => $shop->address . $shop->floor,
                 'lat' => $shop->lat,
                 'lng' => $shop->long,
-                'phone' => $shop->telephone
+                'phone' => $telephone,
             ]
         ];
         // 验证必填参数
@@ -157,6 +161,9 @@ class IntraCityController extends BaseController
             util::fail('地址缺失,请修改');
         }
 
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : '市区';
+        $telephone = !empty($shop->telephone) ? $shop->telephone : $shop->mobile;
         $storeData = [
             'keys' => ['wx_store_id' => $wxStoreId],
             'content' => [
@@ -164,12 +171,12 @@ class IntraCityController extends BaseController
                 'address_info' => [
                     'province' => $shop->province,
                     'city' => $shop->city,
-                    'area' => $shop->dist,
+                    'area' => $dist,
                     'street' => '',
                     'house' => $shop->address . $shop->floor,
                     'lat' => $shop->lat,
                     'lng' => $shop->long,
-                    'phone' => $shop->telephone
+                    'phone' => $telephone
                 ],
                 //"order_pattern" => 2,
                 //"service_trans_prefer" => "SFTC" //order_pattern = 2时必填

+ 1 - 1
app-ghs/controllers/TestController.php

@@ -973,7 +973,7 @@ class TestController extends BaseController
         ];
         $laResource = new Lakala($params);
         $queryParams = [
-            'orderSn' => 'CRS55742',
+            'orderSn' => 'CRS75505',
             //'tradeNo' => '66221061685504',
         ];
         $response = $laResource->query($queryParams, 0);

+ 64 - 34
app-hd/controllers/ConsoleController.php

@@ -2,6 +2,7 @@
 
 namespace hd\controllers;
 
+use bizGhs\stat\classes\StatSaleClass;
 use bizHd\custom\classes\CustomClass;
 use bizHd\goods\classes\GoodsClass;
 use bizHd\order\classes\OrderClass;
@@ -113,22 +114,35 @@ class ConsoleController extends BaseController
                 $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
                 $orderCount = OrderClass::getCount($where);
 
-                $lsIncome = 0;
-                $hdOrderList = OrderClass::getAllByCondition($where, null, 'mainPay, forward, cash');
-                foreach ($hdOrderList as $hdKey => $hdOrder) {
-                    $actPrice = $hdOrder['mainPay'] ?? 0;
-                    $forward = $hdOrder['forward'] ?? 0;
-
-                    if ($forward == 1) { //零售售后付款
-                        // $lsAfterSale = bcadd($lsAfterSale, $actPrice, 2);
-                    } else {
-                        $cash = $hdOrder['cash'] ?? 0;
-                        $lsIncome = bcadd($actPrice, $lsIncome, 2);
-                        $lsIncome = bcadd($lsIncome, $cash, 2);
+                // $lsIncome = 0;
+                // $hdOrderList = OrderClass::getAllByCondition($where, null, 'mainPay, forward, cash');
+                // foreach ($hdOrderList as $hdKey => $hdOrder) {
+                //     $actPrice = $hdOrder['mainPay'] ?? 0;
+                //     $forward = $hdOrder['forward'] ?? 0;
+
+                //     if ($forward == 1) { //零售售后付款
+                //         // $lsAfterSale = bcadd($lsAfterSale, $actPrice, 2);
+                //     } else {
+                //         $cash = $hdOrder['cash'] ?? 0;
+                //         $lsIncome = bcadd($actPrice, $lsIncome, 2);
+                //         $lsIncome = bcadd($lsIncome, $cash, 2);
+                //     }
+                // }
+                $mainId = $this->mainId;
+                $respond = StatSaleClass::profile($mainId);
+                $incomeList = $respond['income'] ?? [];
+                $todaySale = 0;
+                if (!empty($incomeList)) {
+                    //这里有二个地方同时要修改,请搜索关键词:index_show_income
+                    foreach ($incomeList as $item) {
+                        if (isset($item['id']) && $item['id'] == 'allot') {
+                            continue;
+                        }
+                        $todaySale = bcadd($todaySale, $item['amount'], 2);
                     }
                 }
                 $cacheData = [
-                    'lsIncome' => $lsIncome,
+                    'lsIncome' => $todaySale,
                     'orderCount' => $orderCount,
                 ];
                 \Yii::$app->redis->executeCommand('SETEX', [$cacheKey, 1800, json_encode($cacheData, JSON_UNESCAPED_UNICODE)]);
@@ -141,30 +155,46 @@ class ConsoleController extends BaseController
                 $cacheData = json_decode($cache, true);
                 $yesterdayIncome = $cacheData['yesterdayIncome'];
             } else {
-                $period = dateUtil::formatTime('yesterday', '', '', true);
-                $start = $period['startTime'];
-                $end = $period['endTime'];
-                $currentStartDate = date('Y-m-d', strtotime($start));
-                $currentEndDate = date('Y-m-d', strtotime($end));
-                $currentStartTime = $currentStartDate . ' 00:00:00';
-                $currentEndTime = $currentEndDate . ' 23:59:59';
-                $where['time'] = ['between', [$start, $end]];
-                $where = ['mainId' => $mainId, 'status' => ['in', [OrderClass::ORDER_STATUS_UN_SEND, OrderClass::ORDER_STATUS_SENDING, OrderClass::ORDER_STATUS_COMPLETE]]];
-                $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
+                // $period = dateUtil::formatTime('yesterday', '', '', true);
+                // $start = $period['startTime'];
+                // $end = $period['endTime'];
+                // $currentStartDate = date('Y-m-d', strtotime($start));
+                // $currentEndDate = date('Y-m-d', strtotime($end));
+                // $currentStartTime = $currentStartDate . ' 00:00:00';
+                // $currentEndTime = $currentEndDate . ' 23:59:59';
+                // $where['time'] = ['between', [$start, $end]];
+                // $where = ['mainId' => $mainId, 'status' => ['in', [OrderClass::ORDER_STATUS_UN_SEND, OrderClass::ORDER_STATUS_SENDING, OrderClass::ORDER_STATUS_COMPLETE]]];
+                // $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
+                // $yesterdayIncome = 0;
+                // $hdOrderList = OrderClass::getAllByCondition($where, null, 'mainPay, forward, cash');
+                // foreach ($hdOrderList as $hdKey => $hdOrder) {
+                //     $actPrice = $hdOrder['mainPay'] ?? 0;
+                //     $forward = $hdOrder['forward'] ?? 0;
+
+                //     if ($forward == 1) { //零售售后付款
+                //         // $lsAfterSale = bcadd($lsAfterSale, $actPrice, 2);
+                //     } else {
+                //         $cash = $hdOrder['cash'] ?? 0;
+                //         $yesterdayIncome = bcadd($actPrice, $yesterdayIncome, 2);
+                //         $yesterdayIncome = bcadd($yesterdayIncome, $cash, 2);
+                //     }
+                // }
+
+                $mainId = $this->mainId;
+                $_GET['searchTime'] = 'yesterday'; // 必须要有的,让其获取昨天的收入
+                $respond = StatSaleClass::profile($mainId);
+                $incomeList = $respond['income'] ?? [];
                 $yesterdayIncome = 0;
-                $hdOrderList = OrderClass::getAllByCondition($where, null, 'mainPay, forward, cash');
-                foreach ($hdOrderList as $hdKey => $hdOrder) {
-                    $actPrice = $hdOrder['mainPay'] ?? 0;
-                    $forward = $hdOrder['forward'] ?? 0;
-
-                    if ($forward == 1) { //零售售后付款
-                        // $lsAfterSale = bcadd($lsAfterSale, $actPrice, 2);
-                    } else {
-                        $cash = $hdOrder['cash'] ?? 0;
-                        $yesterdayIncome = bcadd($actPrice, $yesterdayIncome, 2);
-                        $yesterdayIncome = bcadd($yesterdayIncome, $cash, 2);
+                if (!empty($incomeList)) {
+                    //这里有二个地方同时要修改,请搜索关键词:index_show_income
+                    foreach ($incomeList as $item) {
+                        if (isset($item['id']) && $item['id'] == 'allot') {
+                            continue;
+                        }
+                        $yesterdayIncome = bcadd($yesterdayIncome, $item['amount'], 2);
                     }
                 }
+
                 $cacheData = [
                     'yesterdayIncome' => $yesterdayIncome,
                 ];

+ 11 - 4
app-hd/controllers/IntraCityController.php

@@ -58,18 +58,21 @@ class IntraCityController extends BaseController
         if (empty($shop->address)) {
             util::fail('地址缺失,请修改');
         }
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : '市区';
+        $telephone = !empty($shop->telephone) ? $shop->telephone : $shop->mobile;
         $storeData = [
             'out_store_id' => $this->mainId, //自定义门店编号 --  从 shopId 改为 mainId
             'store_name' => $name,
             'address_info' => [
                 'province' => $shop->province,
                 'city' => $shop->city,
-                'area' => $shop->dist,
+                'area' => $dist,
                 'street' => '',
                 'house' => $shop->address . $shop->floor,
                 'lat' => $shop->lat,
                 'lng' => $shop->long,
-                'phone' => $shop->telephone
+                'phone' => $telephone
             ]
         ];
         // 验证必填参数
@@ -156,6 +159,10 @@ class IntraCityController extends BaseController
         $sjName = $shop->merchantName ?? '';
         $name = $shopName == '首店' ? $sjName : $sjName . ' ' . $shopName;
 
+        //区是必传,如果没有区,先用市来代替,比如:淘花里中山店,他就是没有区
+        $dist = !empty($shop->dist) ? $shop->dist : '市区';
+        $telephone = !empty($shop->telephone) ? $shop->telephone : $shop->mobile;
+
         $storeData = [
             'keys' => ['wx_store_id' => $wxStoreId],
             'content' => [
@@ -163,12 +170,12 @@ class IntraCityController extends BaseController
                 'address_info' => [
                     'province' => $shop->province,
                     'city' => $shop->city,
-                    'area' => $shop->dist,
+                    'area' => $dist,
                     'street' => '',
                     'house' => $shop->address . $shop->floor,
                     'lat' => $shop->lat,
                     'lng' => $shop->long,
-                    'phone' => $shop->telephone
+                    'phone' => $telephone
                 ],
                 //"order_pattern" => 2,
                 //"service_trans_prefer" => "SFTC" //order_pattern = 2时必填

+ 6 - 1
common/components/book.php

@@ -31,6 +31,7 @@ class book
             ['title' => '用标签机,打标签和价码', 'id' => 'label'],
             ['title' => '大客户价的管理', 'id' => 'super_member'],
             ['title' => '客户下单自动计算跑腿费', 'id' => 'auto_calc_pt_fee'],
+            ['title' => '订单上一键呼叫腿费', 'id' => 'one_call_pt'],
         ]],
         ['class' => '采购', 'icon' => '/book/stock.png', 'list' => [
             ['title' => '采购入库和改价格(重要)', 'id' => 'cg', 'style' => 'red'],
@@ -222,7 +223,11 @@ class book
         'label' => [
             ['style' => 'video', 'value' => 'jc/44labelPrint.mp4'],
         ],
-        'auto_calc_pt_fee'=>[
+        'one_call_pt' => [
+            ['style' => 'video', 'value' => 'jc/one_call_pt.mp4'],
+            ['style' => 'miniTitle', 'value' => '充值的钱没有用完,可以申请退款。',],
+        ],
+        'auto_calc_pt_fee' => [
             ['style' => 'video', 'value' => 'jc/auto_calc_pt_fee.mp4'],
         ],
         'super_member' => [