Bladeren bron

欠款变动记录

shish 2 jaren geleden
bovenliggende
commit
76ab5b1bf8
2 gewijzigde bestanden met toevoegingen van 49 en 0 verwijderingen
  1. 43 0
      app-ghs/controllers/GhsDebtRecordController.php
  2. 6 0
      biz-ghs/ghs/classes/GhsDebtRecordClass.php

+ 43 - 0
app-ghs/controllers/GhsDebtRecordController.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizGhs\custom\classes\CustomClass;
+use bizGhs\custom\classes\CustomDebtChangeClass;
+use bizGhs\ghs\classes\GhsDebtRecordClass;
+use common\components\dict;
+use common\components\util;
+use Yii;
+
+class GhsDebtRecordController extends BaseController
+{
+
+    public $guestAccess = [];
+
+    //欠款变动记录 ssh 20240628
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $customId = $get['customId'] ?? 0;
+        $endTime = $get['endTime']??'';
+        if(empty($customId)){
+            util::fail('请选择客户');
+        }
+        $custom = CustomClass::getById($customId);
+        if(empty($custom)){
+            util::fail('请选择客户哈');
+        }
+        CustomClass::valid($custom, $this->shopId);
+        $where = [];
+        $where['customId'] = $customId;
+        if(!empty($endTime)){
+            $time = bcadd(strtotime($endTime),86400);
+            $endDate = date("Y-m-d 00:00:00",$time);
+            $where['addTime<']=$endDate;
+        }
+
+        $list = GhsDebtRecordClass::getRecordList($where);
+        util::success($list);
+    }
+
+}

+ 6 - 0
biz-ghs/ghs/classes/GhsDebtRecordClass.php

@@ -12,4 +12,10 @@ class GhsDebtRecordClass extends BaseClass
 
     public static $baseFile = '\bizGhs\ghs\models\GhsDebtRecord';
 
+    public static function getRecordList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC,id DESC');
+        return $data;
+    }
+
 }