shish 2 년 전
부모
커밋
81c8773e4e
2개의 변경된 파일7개의 추가작업 그리고 17개의 파일을 삭제
  1. 5 12
      app-ghs/controllers/GhsController.php
  2. 2 5
      biz-ghs/ghs/classes/GhsClass.php

+ 5 - 12
app-ghs/controllers/GhsController.php

@@ -162,28 +162,21 @@ class GhsController extends BaseController
                 $where['name'] = ['like', $name];
             }
         }
-        $type = $get['type'] ?? -1;
         $location = $get['location'] ?? '';
         if (is_numeric($location)) {
             $where['location'] = $location;
         }
-        $order = 'inTurn DESC,addTime DESC';
-        if ($type == 0) {
-            $order = 'debtAmount DESC';
-        }
-        if ($type == 1) {
-            $order = 'expendAmount DESC';
-        }
-        $respond = GhsClass::getGhsList($where, $order);
+        $list = GhsClass::getGhsList($where);
+
         $staff = $this->shopAdmin;
-        //待结款合计,有财务权限才能查看
         if (isset($staff->finance) == false || $staff->finance == 0) {
             $totalDebtAmount = 0;
         } else {
+            //累计总欠款
             $totalDebtAmount = PurchaseOrderClass::sum(['mainId' => $this->mainId, 'status' => 4, 'debt' => PurchaseOrderClass::DEBT_YES], 'actPrice');
         }
-        $respond['totalDebtAmount'] = $totalDebtAmount;
-        util::success($respond);
+        $list['totalDebtAmount'] = $totalDebtAmount;
+        util::success($list);
     }
 
     //下载供货商 ssh 20240506

+ 2 - 5
biz-ghs/ghs/classes/GhsClass.php

@@ -3,7 +3,6 @@
 namespace bizGhs\ghs\classes;
 
 use bizGhs\base\classes\BaseClass;
-use bizGhs\ghs\models\Ghs;
 use bizGhs\order\classes\PurchaseOrderClass;
 use bizGhs\shop\classes\ShopClass;
 use common\components\imgUtil;
@@ -15,12 +14,10 @@ class GhsClass extends BaseClass
     public static $baseFile = '\bizGhs\ghs\models\Ghs';
 
     //供货商列表 ssh 20221220
-    public static function getGhsList($where,$order='inTurn DESC,addTime DESC')
+    public static function getGhsList($where)
     {
-        $data = self::getList('*', $where, $order);
+        $data = self::getList('*', $where, 'inTurn DESC,addTime DESC');
         $data['list'] = self::groupBaseInfo($data['list']);
-        $num = Ghs::find()->where($where)->count();
-        $data['num'] = $num;
         return $data;
     }