]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-325] amo_status to marketplace_status origin/feature_smirnov_erp-325_amo_status
authorAlexander Smirnov <fredeom@mail.ru>
Sat, 22 Feb 2025 19:31:12 +0000 (22:31 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Sat, 22 Feb 2025 19:31:12 +0000 (22:31 +0300)
erp24/api2/controllers/MarketplaceController.php
erp24/migrations/m250221_131205_create_table_amo_status.php [deleted file]
erp24/migrations/m250221_131205_create_table_marketplace_status.php [new file with mode: 0755]
erp24/records/AmoStatus.php [deleted file]
erp24/records/MarketplaceStatus.php [new file with mode: 0644]

index 3436c4608ad7666cc5ad365baaba604633a9ccc0..11773d84f71fd3b514f0680be1ad3531a2e46dd2 100644 (file)
@@ -2,12 +2,12 @@
 
 namespace app\controllers;
 
-use yii_app\records\AmoStatus;
+use yii_app\records\MarketplaceStatus;
 
 class MarketplaceController extends BaseController
 {
     public function actionStatuses() {
         $this->response->format = \yii\web\Response::FORMAT_JSON;
-        return ['response' => AmoStatus::find()->asArray()->all()];
+        return ['response' => MarketplaceStatus::find()->asArray()->all()];
     }
 }
\ No newline at end of file
diff --git a/erp24/migrations/m250221_131205_create_table_amo_status.php b/erp24/migrations/m250221_131205_create_table_amo_status.php
deleted file mode 100755 (executable)
index 5a9be43..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-use yii\db\Migration;
-
-/**
- * Class m250221_131205_create_table_amo_status
- */
-class m250221_131205_create_table_amo_status extends Migration
-{
-    const TABLE_NAME = 'erp24.amo_status';
-
-    /**
-     * {@inheritdoc}
-     */
-    public function safeUp()
-    {
-        $this->createTable(self::TABLE_NAME, [
-            'id' => $this->primaryKey(),
-            'alias' => $this->string(100)->notNull()->comment('alias статуса'),
-            'name' => $this->string(100)->notNull()->comment('наименование статуса на русском'),
-        ]);
-
-        $this->batchInsert(self::TABLE_NAME, ['id', 'alias', 'name'], [
-            [1, 'new', 'Новая сделка'],
-            [2, 'in_work', 'Взято в работу'],
-            [3, 'agree', 'Согласован'],
-            [4, 'not_contacted', 'Связывались более 2 раз'],
-            [5, 'client_identity', 'Клиент идентифицирован'],
-            [6, 'to_florist', 'Передано флористу'],
-            [7, 'photo_send', 'Фото отправлено, ожидание подтверждения клиента'],
-            [8, 'florist_edit', 'Правки флориста'],
-            [9, 'self_delivery', 'Передано на самовывоз'],
-            [10, 'verify_select_courier', 'Согласован, выбор курьера'],
-            [11, 'select_courier', 'Выбор курьера'],
-            [12, 'delivery', 'Заказ передан курьеру'],
-            [13, 'success', 'Успешно'],
-            [14, 'close_dont_buy', 'Закрыто и не реализовано'],
-            // ***
-            [15, 'to_delivery', 'на доставку'],
-            [16, 'assembled', 'собран'],
-            [17, 'agreement_with_client', 'согласование с клиентом'],
-            [18, 'refuse', 'отказ'],
-            [19, 'delivered', 'доставлено'],
-            [20, 'customer_return_refusal_after_delivery', 'возврат от клиента, отказ после доставки']
-        ]);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function safeDown()
-    {
-        $this->dropTable(self::TABLE_NAME);
-    }
-}
diff --git a/erp24/migrations/m250221_131205_create_table_marketplace_status.php b/erp24/migrations/m250221_131205_create_table_marketplace_status.php
new file mode 100755 (executable)
index 0000000..83bd9bb
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m250221_131205_create_table_amo_status
+ */
+class m250221_131205_create_table_marketplace_status extends Migration
+{
+    const TABLE_NAME = 'erp24.marketplace_status';
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+        $this->createTable(self::TABLE_NAME, [
+            'id' => $this->primaryKey(),
+            'alias' => $this->string(100)->notNull()->comment('alias статуса'),
+            'name' => $this->string(100)->notNull()->comment('наименование статуса на русском'),
+        ]);
+
+        $this->batchInsert(self::TABLE_NAME, ['id', 'alias', 'name'], [
+            [1, 'new', 'Новая сделка'],
+            [2, 'in_work', 'Взято в работу'],
+            [3, 'agree', 'Согласован'],
+            [4, 'not_contacted', 'Связывались более 2 раз'],
+            [5, 'client_identity', 'Клиент идентифицирован'],
+            [6, 'to_florist', 'Передано флористу'],
+            [7, 'photo_send', 'Фото отправлено, ожидание подтверждения клиента'],
+            [8, 'florist_edit', 'Правки флориста'],
+            [9, 'self_delivery', 'Передано на самовывоз'],
+            [10, 'verify_select_courier', 'Согласован, выбор курьера'],
+            [11, 'select_courier', 'Выбор курьера'],
+            [12, 'delivery', 'Заказ передан курьеру'],
+            [13, 'success', 'Успешно'],
+            [14, 'close_dont_buy', 'Закрыто и не реализовано'],
+            // ***
+            [15, 'to_delivery', 'на доставку'],
+            [16, 'assembled', 'собран'],
+            [17, 'agreement_with_client', 'согласование с клиентом'],
+            [18, 'refuse', 'отказ'],
+            [19, 'delivered', 'доставлено'],
+            [20, 'customer_return_refusal_after_delivery', 'возврат от клиента, отказ после доставки']
+        ]);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->dropTable(self::TABLE_NAME);
+    }
+}
diff --git a/erp24/records/AmoStatus.php b/erp24/records/AmoStatus.php
deleted file mode 100644 (file)
index 37219a7..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-namespace yii_app\records;
-
-use Yii;
-
-/**
- * This is the model class for table "amo_status".
- *
- * @property int $id
- * @property string $alias alias статуса
- * @property string $name наименование статуса на русском
- */
-class AmoStatus extends \yii\db\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return 'amo_status';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['alias', 'name'], 'required'],
-            [['alias', 'name'], 'string', 'max' => 100],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'id' => 'ID',
-            'alias' => 'Alias',
-            'name' => 'Name',
-        ];
-    }
-}
diff --git a/erp24/records/MarketplaceStatus.php b/erp24/records/MarketplaceStatus.php
new file mode 100644 (file)
index 0000000..9eb9855
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+namespace yii_app\records;
+
+use Yii;
+
+/**
+ * This is the model class for table "amo_status".
+ *
+ * @property int $id
+ * @property string $alias alias статуса
+ * @property string $name наименование статуса на русском
+ */
+class MarketplaceStatus extends \yii\db\ActiveRecord
+{
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return 'marketplace_status';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['alias', 'name'], 'required'],
+            [['alias', 'name'], 'string', 'max' => 100],
+        ];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'id' => 'ID',
+            'alias' => 'Alias',
+            'name' => 'Name',
+        ];
+    }
+}