shish 1 год назад
Родитель
Сommit
cab9f64a59

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

@@ -395,7 +395,7 @@ class ShopController extends BaseController
         $shop = $this->shop;
         $sjName = $shop->merchantName ?? '';
         $shopName = $shop->shopName ?? '';
-        noticeUtil::push("{$sjName}-{$shopName} 修改提现账号,{$cashName} {$cashAccount} {$cashBank}", '15280215347');
+        //noticeUtil::push("{$sjName}-{$shopName} 修改提现账号,{$cashName} {$cashAccount} {$cashBank}", '15280215347');
 
         util::complete();
     }

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

@@ -350,6 +350,7 @@ class TestController extends BaseController
             //['name' => '海沧好多花换店', 'merchantNo' => '8223930599200CN', 'wx' => [772684174, 772684211], 'zfb' => '2088370864383343'],
             //['name' => '九江伊朵鲜花批发', 'merchantNo' => '82242405992002A', 'wx' => [774681090, 774681246], 'zfb' => '2088470298005142'],
             ['name' => '徐州云之南鲜花', 'merchantNo' => '82230305992005R', 'wx' => [774780650, 774780913], 'zfb' => '2088470313464547'],
+            ['name' => '昆明建芳基地鲜花直发', 'merchantNo' => '8223970599200AH', 'wx' => [775915046, 775915051], 'zfb' => '2088470558755358'],
             //['name' => '日照月下鲜花批发', 'merchantNo' => '82247705992002D', 'wx' => [759404451, 759404055], 'zfb' => '2088170264295192'],
             //['name' => '陆丰幸运花坊', 'merchantNo' => '82259705992001N', 'wx' => [762636401,762635754 ], 'zfb' => '2088170810827880'],
             //['name' => '阜阳芳棠鲜花批发', 'merchantNo' => '82237205992002Q', 'wx' => [733203298, 733203681], 'zfb' => '2088660084283241'],

+ 7 - 0
app-hd/controllers/GhsController.php

@@ -166,6 +166,13 @@ class GhsController extends BaseController
         $where = [];
         $where['ownShopId'] = $this->shopId;
         $where['delStatus'] = $delStatus;
+
+        $name = isset($get['name']) ? $get['name'] : '';
+        if (stringUtil::isLetter($name)) {
+            $where['py'] = ['like', $name];
+        } else {
+            $where['name'] = ['like', $name];
+        }
         $respond = GhsClass::getGhsList($where);
 
         //广告列表

+ 1 - 1
app-hd/controllers/ShopController.php

@@ -314,7 +314,7 @@ class ShopController extends BaseController
         $shop = $this->shop;
         $sjName = $shop->merchantName ?? '';
         $shopName = $shop->shopName ?? '';
-        noticeUtil::push("{$sjName}-{$shopName} 修改提现账号,{$cashName} {$cashAccount} {$cashBank}", '15280215347');
+        //noticeUtil::push("{$sjName}-{$shopName} 修改提现账号,{$cashName} {$cashAccount} {$cashBank}", '15280215347');
 
         util::complete();
     }

+ 28 - 4
app-hd/controllers/StatCgController.php

@@ -2,6 +2,7 @@
 
 namespace hd\controllers;
 
+use bizHd\ghs\classes\GhsClass;
 use bizHd\product\classes\ProductClass;
 use bizHd\purchase\classes\PurchaseItemClass;
 use common\components\arrayUtil;
@@ -17,7 +18,7 @@ class StatCgController extends BaseController
     {
         $get = Yii::$app->request->get();
         $where = ['mainId' => $this->mainId];
-        $searchTime = isset($get['searchTime']) && !empty($get['searchTime']) ? $get['searchTime'] : 'today';
+        $searchTime = !empty($get['searchTime']) ? $get['searchTime'] : 'today';
         $startTime = $get['startTime'] ?? '';
         $endTime = $get['endTime'] ?? '';
         $period = dateUtil::formatTime($searchTime, $startTime, $endTime, true);
@@ -26,9 +27,21 @@ class StatCgController extends BaseController
         $startDate = date("Y-m-d 00:00:00", strtotime($start));
         $endDate = date("Y-m-d 23:59:59", strtotime($end));
         $where['payTime'] = ['between', [$startDate, $endDate]];
-        if (isset($get['ghsId']) && !empty($get['ghsId'])) {
+        if (!empty($get['ghsId'])) {
             $where['ghsId'] = $get['ghsId'];
         }
+
+        $showGhsParam = $get['showGhsParam'] ?? 0;
+        $ghsProduct = [];
+        if ($showGhsParam == 1) {
+            $ghsId = $get['ghsId'] ?? 0;
+            $ghs = GhsClass::getById($ghsId, true);
+            if (!empty($ghs)) {
+                $ghsMainId = $ghs->mainId ?? 0;
+                $ghsProduct = ProductClass::getAllByCondition(['mainId' => $ghsMainId, 'delStatus' => 0], null, 'id,name,itemId', 'itemId');
+            }
+        }
+
         $list = PurchaseItemClass::getAllByCondition($where, null, '*');
         if (empty($list)) {
             util::success(['list' => $list]);
@@ -41,8 +54,10 @@ class StatCgController extends BaseController
         $totalAmount = 0;
         foreach ($list as $key => $val) {
             $productId = $val['productId'] ?? 0;
+            $ptItemId = $val['itemId'] ?? 0;
             $xhUnitType = $val['xhUnitType'] ?? 0;
             $xhUnitPrice = $val['xhUnitPrice'] ?? 0;
+
             $ratio = $val['ratio'] ?? 20;
             $beforeNum = bcsub($val['xhNum'], $val['refundNum'], 2);
             if ($xhUnitType == 0) {
@@ -53,8 +68,17 @@ class StatCgController extends BaseController
             $amount = bcmul($num, $xhUnitPrice, 2);
             $totalNum = bcadd($totalNum, $num, 2);
             $totalAmount = bcadd($totalAmount, $amount, 2);
-            $name = $productInfo[$productId]['name'] ?? '';
-            $py = $productInfo[$productId]['py'] ?? '';
+            $myCurrentInfo = $productInfo[$productId] ?? [];
+
+            if ($showGhsParam == 1) {
+                $myGhsItem = $ghsProduct[$ptItemId] ?? [];
+                $name = $myGhsItem['name'] ?? '未找到';
+                $py = $myGhsItem['py'] ?? '';
+            } else {
+                $name = $myCurrentInfo['name'] ?? '';
+                $py = $myCurrentInfo['py'] ?? '';
+            }
+
             $stat[$productId]['productId'] = $productId;
             $stat[$productId]['name'] = $name;
             $stat[$productId]['py'] = $py;

+ 1 - 1
biz-hd/cg/classes/CgRefundClass.php

@@ -71,7 +71,7 @@ class CgRefundClass extends BaseClass
         $response = $laResource->refund($backParams);
         if (!isset($response['code']) || $response['code'] != 'BBS00000') {
             $errMsg = $response['msg'] ?? '';
-            noticeUtil::push("钱退回失败 success {$orderSn} {$errMsg}", '15280215347');
+            noticeUtil::push("钱退回失败 {$orderSn} {$errMsg}", '15280215347');
             return ['status' => 0, 'msg' => $errMsg];
         } else {
             $ghsShopId = $ghsShop->id;