Browse Source

修改订单错误字段

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
2f8abe09cf
  1. 2
      backend/views/order/view.php
  2. 8
      common/models/ars/Order.php
  3. 6
      common/models/searchs/OrderSearch.php
  4. 20
      console/migrations/m191203_114421_update_column_discount_description_in_table_order.php

2
backend/views/order/view.php

@ -43,7 +43,7 @@ $this->params['breadcrumbs'][] = $this->title;
'receivables', 'receivables',
'remarks', 'remarks',
'discount_amount', 'discount_amount',
'discount_decription:ntext',
'discount_description:ntext',
'updated_at', 'updated_at',
'created_at', 'created_at',
], ],

8
common/models/ars/Order.php

@ -31,7 +31,7 @@ use yii\behaviors\TimestampBehavior;
* @property int $receivables 应收款 * @property int $receivables 应收款
* @property string $remarks 备注 * @property string $remarks 备注
* @property int $discount_amount 折扣金额 * @property int $discount_amount 折扣金额
* @property string $discount_decription 折扣说明
* @property string $discount_description 折扣说明
* @property int $updated_at 更新时间 * @property int $updated_at 更新时间
* @property int $created_at 创建时间 * @property int $created_at 创建时间
* @property string $address 详细地址 * @property string $address 详细地址
@ -52,9 +52,9 @@ class Order extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ 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'], [['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], [['order_sn', 'invoice_id'], 'string', 'max' => 64],
[['consignee', 'phone'], 'string', 'max' => 20], [['consignee', 'phone'], 'string', 'max' => 20],
[['province', 'city', 'area'], 'string', 'max' => 10], [['province', 'city', 'area'], 'string', 'max' => 10],
@ -92,7 +92,7 @@ class Order extends \yii\db\ActiveRecord
'receivables' => '应收款', 'receivables' => '应收款',
'remarks' => '备注', 'remarks' => '备注',
'discount_amount' => '折扣金额', 'discount_amount' => '折扣金额',
'discount_decription' => '折扣说明',
'discount_description' => '折扣说明',
'updated_at' => '更新时间', 'updated_at' => '更新时间',
'created_at' => '创建时间', 'created_at' => '创建时间',
'address' => '详细地址', 'address' => '详细地址',

6
common/models/searchs/OrderSearch.php

@ -27,7 +27,7 @@ class OrderSearch extends Order
{ {
return [ 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'], [['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'], ['created_at_range','safe'],
]; ];
} }
@ -75,7 +75,7 @@ class OrderSearch extends Order
//'receivables', //'receivables',
//'remarks', //'remarks',
//'discount_amount', //'discount_amount',
//'discount_decription',
//'discount_description',
//'updated_at', //'updated_at',
//'created_at', //'created_at',
[ [
@ -171,7 +171,7 @@ class OrderSearch extends Order
->andFilterWhere(['like', 'area', $this->area]) ->andFilterWhere(['like', 'area', $this->area])
->andFilterWhere(['like', 'payment_sn', $this->payment_sn]) ->andFilterWhere(['like', 'payment_sn', $this->payment_sn])
->andFilterWhere(['like', 'remarks', $this->remarks]) ->andFilterWhere(['like', 'remarks', $this->remarks])
->andFilterWhere(['like', 'discount_decription', $this->discount_decription]);
->andFilterWhere(['like', 'discount_description', $this->discount_description]);
if ($this->created_at_range) { if ($this->created_at_range) {
$arr = explode(' ~ ', $this->created_at_range); $arr = explode(' ~ ', $this->created_at_range);
$start = strtotime($arr[0]); $start = strtotime($arr[0]);

20
console/migrations/m191203_114421_update_column_discount_description_in_table_order.php

@ -0,0 +1,20 @@
<?php
use yii\db\Migration;
/**
* Class m191203_114421_update_column_discount_description_in_table_order
*/
class m191203_114421_update_column_discount_description_in_table_order extends Migration
{
public function up()
{
$this->dropColumn('ats_order', 'discount_decription');
$this->addColumn('ats_order', 'discount_description', $this->text()->comment('折扣说明'));
}
public function down()
{
return true;
}
}
Loading…
Cancel
Save