200], [['logo', 'address_details', 'longitude', 'latitude', 'mobile', 'contacts'], 'string', 'max' => 100], [['cover'], 'string', 'max' => 150], [['brief_introduction'], 'string', 'max' => 1000], [['email'], 'string', 'max' => 60], [['email'], 'email'], [['start_time', 'end_time'], 'safe'], ['mobile', 'match', 'pattern' => RegularHelper::mobile(), 'message' => '请输入正确的手机号'], [['tel_no'], 'string', 'max' => 20], [['keywords', 'description', 'close_cause'], 'string', 'max' => 255], [['qq'], 'string', 'max' => 50], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'title' => '店铺名称', 'operating_type' => '运营类型', 'cate_id' => '主营行业', 'tax_rate' => '税率', 'logo' => '商户 Logo', 'cover' => '商户头像', 'sort' => '店铺排序', 'brief_introduction' => '简介', 'term_of_validity_type' => '有效期类型', 'start_time' => '开始时间', 'end_time' => '到期时间', 'email' => '邮箱', 'province_id' => '省', 'city_id' => '城市', 'area_id' => '地区', 'address_name' => '地址', 'address_details' => '详细地址', 'longitude' => '经度', 'latitude' => '纬度', 'contacts' => '联系人', 'mobile' => '手机号码', 'tel_no' => '电话号码', 'level_id' => '店铺等级', 'keywords' => '店铺关键字', 'description' => '店铺 seo 描述', 'environment' => '环境相册', 'qq' => 'QQ', 'credit' => '店铺信用', 'desc_credit' => '描述相符度分数', 'service_credit' => '服务态度分数', 'delivery_credit' => '发货速度分数', 'sales_money' => '店铺销售额', 'business_week' => '每周营业日期', 'business_time' => '营业开始时间', 'collect_num' => '收藏数量', 'comment_num' => '评价数', 'transmit_num' => '分享数', 'auth_role_id' => '开店套餐', 'certification_type' => '认证类型', 'close_cause' => '店铺关闭原因', 'audit_status' => '审核状态', 'status' => '状态', 'created_at' => '创建时间', 'updated_at' => '修改时间', ]; } public function attributeHints() { return [ 'keywords' => '多个关键字之间用英文“,”隔开' ]; } public function beforeSave($insert) { $this->start_time = StringHelper::dateToInt($this->start_time); $this->end_time = StringHelper::dateToInt($this->end_time); if (isset($this->oldAttributes['area_id']) && $this->area_id != $this->oldAttributes['area_id']) { $this->address_name = Yii::$app->services->provinces->getCityListName([$this->province_id, $this->city_id, $this->area_id]); } return parent::beforeSave($insert); } }