|
|
<?php
namespace backend\modules\shop\models\ars;
use Yii; use yii\behaviors\TimestampBehavior;
/** * This is the model class for table "ats_taking_site". * * @property int $id * @property string $name 名称 * @property int $updated_at 更新时间 * @property int $created_at 创建时间 * @property string $province 省份 * @property string $city 城市 * @property string $area 区域 * @property string $address 地址 */ class TakingSite extends \yii\db\ActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return 'ats_taking_site'; }
/** * {@inheritdoc} */ public function rules() { return [ [['name', 'province', 'city', 'area', 'address'], 'required'], [['address'], 'string'], [['name'], 'string', 'max' => 120], [['province', 'city', 'area'], 'string', 'max' => 64], ]; }
/** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'id', 'name' => '名称', 'updated_at' => '更新时间', 'created_at' => '创建时间', 'province' => '省份', 'city' => '城市', 'area' => '区域', 'address' => '地址', ]; }
/** * @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(); }, ], ]; } }
|