Răsfoiți Sursa

成本变动记录

shish 3 ani în urmă
părinte
comite
9a7d29fb6d

+ 26 - 0
app-ghs/controllers/CostChangeController.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 CostChangeController 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 = CostChangeClass::getChangeList($where);
+        util::success($list);
+    }
+
+}

+ 24 - 0
biz-ghs/item/classes/CostChangeClass.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace bizGhs\item\classes;
+
+use bizGhs\base\classes\BaseClass;
+
+class CostChangeClass extends BaseClass
+{
+
+    public static $baseFile = '\bizGhs\item\models\CostChange';
+
+    public static function getChangeList($where)
+    {
+        $data = self::getList('*', $where, 'addTime DESC');
+        return $data;
+    }
+
+    //增加价格变动记录 ssh 20221108
+    public static function addData($data)
+    {
+        return self::add($data, true);
+    }
+
+}

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

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