'按重量', self::CALCULATION_NUMBER => '按件数' ]; /** * {@inheritdoc} */ public static function tableName() { return 'ats_express_template'; } /** * {@inheritdoc} */ public function rules() { return [ [['name'], 'required'], [['province', 'city', 'area'], 'string'], [['calculation', 'basic_price', 'basic_amount', 'extra_price', 'extra_amount'], 'integer'], [['name'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'id', 'name' => '名称', 'province' => '省份', 'city' => '城市', 'area' => '区域', 'calculation' => '计算方式', 'basic_price' => '基本运费', 'basic_amount' => '基本数量', 'extra_price' => '续重运费', 'extra_amount' => '续重运费', '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(); }, ], ]; } }