shish 2 年 前
コミット
c9c69066ec

+ 40 - 0
app-ghs/controllers/BookCustomOnChangeController.php

@@ -0,0 +1,40 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizGhs\book\classes\BookChangeClass;
+use bizGhs\book\classes\BookChangeGlobalClass;
+use bizGhs\book\classes\BookCustomChangeClass;
+use bizGhs\book\classes\BookCustomClass;
+use bizGhs\book\classes\BookCustomOnChangeClass;
+use bizGhs\book\classes\BookItemClass;
+use bizGhs\book\classes\BookItemCustomClass;
+use common\components\book;
+use common\components\util;
+use Yii;
+
+class BookCustomOnChangeController extends BaseController
+{
+
+    public $guestAccess = [];
+
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $relateSecondId = $get['relateSecondId'] ?? 0;
+        $customId = $get['customId'] ?? 0;
+        $info = BookCustomClass::getById($relateSecondId, true);
+        if (empty($info)) {
+            util::fail('没有找到');
+        }
+        if ($info->mainId != $this->mainId) {
+            util::fail('不是你的哦');
+        }
+        $where = [];
+        $where['relateSecondId'] = $relateSecondId;
+        $where['customId'] = $customId;
+        $respond = BookCustomOnChangeClass::getChangeList($where);
+        util::success($respond);
+    }
+
+}

+ 37 - 0
app-ghs/controllers/BookOnChangeController.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizGhs\book\classes\BookChangeClass;
+use bizGhs\book\classes\BookItemCustomClass;
+use bizGhs\book\classes\BookOnChangeClass;
+use common\components\util;
+use Yii;
+
+class BookOnChangeController extends BaseController
+{
+
+    public $guestAccess = [];
+
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $relateSecondId = $get['relateSecondId'] ?? 0;
+        $itemId = $get['itemId'] ?? 0;
+        $customId = $get['customId'] ?? 0;
+        $info = BookItemCustomClass::getById($relateSecondId, true);
+        if (empty($info)) {
+            util::fail('没有找到');
+        }
+        if ($info->mainId != $this->mainId) {
+            util::fail('不是你的哦');
+        }
+        $where = [];
+        $where['relateSecondId'] = $relateSecondId;
+        $where['customId'] = $customId;
+        $where['itemId'] = $itemId;
+        $respond = BookOnChangeClass::getChangeList($where);
+        util::success($respond);
+    }
+
+}

+ 36 - 0
app-ghs/controllers/BookOnChangeGlobalController.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizGhs\book\classes\BookChangeGlobalClass;
+use bizGhs\book\classes\BookItemClass;
+use bizGhs\book\classes\BookOnChangeGlobalClass;
+use common\components\book;
+use common\components\util;
+use Yii;
+
+class BookOnChangeGlobalController extends BaseController
+{
+
+    public $guestAccess = [];
+
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $relateSecondId = $get['relateSecondId'] ?? 0;
+        $itemId = $get['itemId'] ?? 0;
+        $info = BookItemClass::getById($relateSecondId,true);
+        if (empty($info)) {
+            util::fail('没有找到');
+        }
+        if ($info->mainId != $this->mainId) {
+            util::fail('不是你的哦');
+        }
+        $where = [];
+        $where['relateSecondId'] = $relateSecondId;
+        $where['itemId'] = $itemId;
+        $respond = BookOnChangeGlobalClass::getChangeList($where);
+        util::success($respond);
+    }
+
+}

+ 6 - 0
biz-ghs/book/classes/BookCustomOnChangeClass.php

@@ -9,4 +9,10 @@ class BookCustomOnChangeClass extends BaseClass
 
     public static $baseFile = '\bizGhs\book\models\BookCustomOnChange';
 
+    public static function getChangeList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC,id DESC');
+        return $data;
+    }
+
 }

+ 6 - 0
biz-ghs/book/classes/BookOnChangeClass.php

@@ -9,4 +9,10 @@ class BookOnChangeClass extends BaseClass
 
     public static $baseFile = '\bizGhs\book\models\BookOnChange';
 
+    public static function getChangeList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC,id DESC');
+        return $data;
+    }
+
 }

+ 7 - 0
biz-ghs/book/classes/BookOnChangeGlobalClass.php

@@ -9,4 +9,11 @@ class BookOnChangeGlobalClass extends BaseClass
 
     public static $baseFile = '\bizGhs\book\models\BookOnChangeGlobal';
 
+    public static function getChangeList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC,id DESC');
+        return $data;
+    }
+
+
 }