Parcourir la source

价格变动记录明细

shish il y a 3 ans
Parent
commit
36abe30fae

+ 26 - 0
app-ghs/controllers/PriceChangeController.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace ghs\controllers;
+
+use bizGhs\item\classes\PriceChangeClass;
+use bizGhs\product\classes\ProductClass;
+use common\components\util;
+use Yii;
+
+class PriceChangeController extends BaseController
+{
+
+    public function actionList()
+    {
+        $get = Yii::$app->request->get();
+        $id = $get['id'] ?? 0;
+        $product = ProductClass::getById($id, true);
+        if ($product->mainId != $this->mainId) {
+            util::fail('没有权限');
+        }
+        $where = ['itemId' => $id];
+        $list = PriceChangeClass::getChangeList($where);
+        util::success($list);
+    }
+
+}

+ 18 - 0
biz-ghs/item/classes/PriceChangeClass.php

@@ -0,0 +1,18 @@
+<?php
+
+namespace bizGhs\item\classes;
+
+use bizGhs\base\classes\BaseClass;
+
+class PriceChangeClass extends BaseClass
+{
+
+    public static $baseFile = '\bizGhs\item\models\PriceChange';
+
+    public static function getChangeList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC');
+        return $data;
+    }
+
+}

+ 13 - 0
biz-ghs/item/models/PriceChange.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace bizGhs\item\models;
+use bizGhs\base\models\Base;
+class PriceChange extends Base
+{
+
+    public static function tableName()
+    {
+        return 'xhGhsPriceChange';
+    }
+
+}

+ 11 - 0
biz-ghs/item/services/PriceChangeService.php

@@ -0,0 +1,11 @@
+<?php
+namespace bizGhs\item\services;
+
+use bizGhs\base\services\BaseService;
+
+class PriceChangeService extends BaseService
+{
+
+    public static $baseFile = '\bizGhs\item\classes\PriceChangeClass';
+
+}