From 2f8abe09cf0041b75fa461085b01c91f478269af Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Tue, 3 Dec 2019 19:53:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/views/order/view.php | 2 +- common/models/ars/Order.php | 8 ++++---- common/models/searchs/OrderSearch.php | 6 +++--- ...mn_discount_description_in_table_order.php | 20 +++++++++++++++++++ 4 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 console/migrations/m191203_114421_update_column_discount_description_in_table_order.php diff --git a/backend/views/order/view.php b/backend/views/order/view.php index 3c2c76b..7cd4293 100755 --- a/backend/views/order/view.php +++ b/backend/views/order/view.php @@ -43,7 +43,7 @@ $this->params['breadcrumbs'][] = $this->title; 'receivables', 'remarks', 'discount_amount', - 'discount_decription:ntext', + 'discount_description:ntext', 'updated_at', 'created_at', ], diff --git a/common/models/ars/Order.php b/common/models/ars/Order.php index 1ddcebd..a180302 100644 --- a/common/models/ars/Order.php +++ b/common/models/ars/Order.php @@ -31,7 +31,7 @@ use yii\behaviors\TimestampBehavior; * @property int $receivables 应收款 * @property string $remarks 备注 * @property int $discount_amount 折扣金额 - * @property string $discount_decription 折扣说明 + * @property string $discount_description 折扣说明 * @property int $updated_at 更新时间 * @property int $created_at 创建时间 * @property string $address 详细地址 @@ -52,9 +52,9 @@ class Order extends \yii\db\ActiveRecord public function rules() { return [ - [['user_id', 'address'], 'required'], + [['user_id'], 'required'], [['user_id', 'status', 'type', 'goods_count', 'goods_amount', 'shipping_amount', 'shipping_type', 'taking_site', 'pay_type', 'pay_at', 'payment_amount', 'receivables', 'discount_amount'], 'integer'], - [['discount_decription', 'address'], 'string'], + [['discount_description', 'address'], 'string'], [['order_sn', 'invoice_id'], 'string', 'max' => 64], [['consignee', 'phone'], 'string', 'max' => 20], [['province', 'city', 'area'], 'string', 'max' => 10], @@ -92,7 +92,7 @@ class Order extends \yii\db\ActiveRecord 'receivables' => '应收款', 'remarks' => '备注', 'discount_amount' => '折扣金额', - 'discount_decription' => '折扣说明', + 'discount_description' => '折扣说明', 'updated_at' => '更新时间', 'created_at' => '创建时间', 'address' => '详细地址', diff --git a/common/models/searchs/OrderSearch.php b/common/models/searchs/OrderSearch.php index c141e81..8b7fa29 100755 --- a/common/models/searchs/OrderSearch.php +++ b/common/models/searchs/OrderSearch.php @@ -27,7 +27,7 @@ class OrderSearch extends Order { return [ [['id', 'user_id', 'status', 'type', 'goods_count', 'goods_amount', 'shipping_amount', 'shipping_type', 'taking_site', 'pay_type', 'pay_at', 'payment_amount', 'receivables', 'discount_amount', 'updated_at', 'created_at'], 'integer'], - [['order_sn', 'invoice_id', 'consignee', 'phone', 'province', 'city', 'area', 'payment_sn', 'remarks', 'discount_decription'], 'safe'], + [['order_sn', 'invoice_id', 'consignee', 'phone', 'province', 'city', 'area', 'payment_sn', 'remarks', 'discount_description'], 'safe'], ['created_at_range','safe'], ]; } @@ -75,7 +75,7 @@ class OrderSearch extends Order //'receivables', //'remarks', //'discount_amount', - //'discount_decription', + //'discount_description', //'updated_at', //'created_at', [ @@ -171,7 +171,7 @@ class OrderSearch extends Order ->andFilterWhere(['like', 'area', $this->area]) ->andFilterWhere(['like', 'payment_sn', $this->payment_sn]) ->andFilterWhere(['like', 'remarks', $this->remarks]) - ->andFilterWhere(['like', 'discount_decription', $this->discount_decription]); + ->andFilterWhere(['like', 'discount_description', $this->discount_description]); if ($this->created_at_range) { $arr = explode(' ~ ', $this->created_at_range); $start = strtotime($arr[0]); diff --git a/console/migrations/m191203_114421_update_column_discount_description_in_table_order.php b/console/migrations/m191203_114421_update_column_discount_description_in_table_order.php new file mode 100644 index 0000000..9ff01eb --- /dev/null +++ b/console/migrations/m191203_114421_update_column_discount_description_in_table_order.php @@ -0,0 +1,20 @@ +dropColumn('ats_order', 'discount_decription'); + $this->addColumn('ats_order', 'discount_description', $this->text()->comment('折扣说明')); + } + + public function down() + { + return true; + } +}