Browse Source

创建运费区域价格model

antshop
linyaostalker 5 years ago
parent
commit
02fae18bb5
  1. 85
      backend/modules/shop/models/ars/ExpressArea.php

85
backend/modules/shop/models/ars/ExpressArea.php

@ -0,0 +1,85 @@
<?php
namespace backend\modules\shop\models\ars;
use Yii;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "ats_express_area".
*
* @property int $id
* @property string $province 省份
* @property string $city 城市
* @property string $area 区域
* @property int $express_template 运费模板id
* @property int $extra_price 续重运费
* @property int $basic_price 基本运费
* @property int $basic_count 基本数量
* @property int $extra_count 续重数量
* @property int $updated_at 更新时间
* @property int $created_at 创建时间
*/
class ExpressArea extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'ats_express_area';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['province', 'city', 'area'], 'string'],
[['express_template', 'extra_price', 'basic_price', 'basic_count', 'extra_count'], 'integer'],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'id',
'province' => '省份',
'city' => '城市',
'area' => '区域',
'express_template' => '运费模板id',
'extra_price' => '续重运费',
'basic_price' => '基本运费',
'basic_count' => '基本数量',
'extra_count' => '续重数量',
'updated_at' => '更新时间',
'created_at' => '创建时间',
];
}
/**
* @author linyao
* @email 602604991@qq.com
* @created Nov 8, 2019
*
* 行为存储创建时间和更新时间
*/
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
'value' => function() {
return time();
},
],
];
}
}
Loading…
Cancel
Save