50], [['tag', 'cover', 'file', 'keywords'], 'string', 'max' => 100], [['description', 'head_portrait'], 'string', 'max' => 200], [['email'], 'string', 'max' => 60], [['time'], 'string', 'max' => 20], [['color'], 'string', 'max' => 7], [['longitude', 'latitude'], 'string', 'max' => 30], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'merchant_id' => '商户id', 'member_id' => '管理员ID', 'title' => '标题', 'cate_id' => '分类', 'cate_ids' => '分类组', 'sort' => '排序', 'gender' => '性别', 'head_portrait' => '头像', 'content' => '内容', 'tag' => '单选标签', 'multiple_input' => '多输入框', 'cover' => '单图', 'covers' => '多图', 'file' => '单文件', 'files' => '多文件', 'keywords' => '关键字', 'description' => '描述', 'price' => '价格', 'views' => '点击', 'start_time' => '开始时间', 'end_time' => '结束时间', 'email' => '邮箱', 'province_id' => '省', 'city_id' => '市', 'area_id' => '区', 'ip' => 'ip', 'date' => '日期', 'time' => '时间', 'color' => '颜色', 'longitude' => '经纬度', 'latitude' => '经纬度', 'status' => '状态', 'created_at' => '创建时间', 'updated_at' => '更新时间', ]; } /** * @return \yii\db\ActiveQuery */ public function getCate() { return $this->hasOne(Cate::class, ['id' => 'cate_id']); } public function beforeSave($insert) { $this->start_time = StringHelper::dateToInt($this->start_time); $this->end_time = StringHelper::dateToInt($this->end_time); return parent::beforeSave($insert); } }