30], [['name', 'start_time', 'end_time'], 'required'], [['start_time', 'end_time'], 'safe'], [['cover'], 'string', 'max' => 100], [['silder_text'], 'string', 'max' => 150], [['jump_link'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => '序号', 'merchant_id' => '商户id', 'store_id' => '店铺id', 'name' => '标题', 'cover' => '图片', 'location_id' => '广告位ID', 'silder_text' => '图片描述', 'start_time' => '开始时间', 'end_time' => '结束时间', 'jump_link' => '跳转链接', 'jump_type' => '跳转方式', // [1:新标签; 2:当前页] 'sort' => '优先级', 'status' => '状态', 'created_at' => '创建时间', 'updated_at' => '更新时间', ]; } /** * @param bool $insert * @return bool */ public function beforeSave($insert) { $this->start_time = StringHelper::dateToInt($this->start_time); $this->end_time = StringHelper::dateToInt($this->end_time); return parent::beforeSave($insert); } }