TimestampBehavior::class, 'value' => time() ] ]; } /** * @inheritdoc */ public function rules() { return [ // [['store_id', 'user_id', 'realname', 'tel', 'mch_common_cat_id'], 'required'], [['store_id', 'user_id', 'saas_user_id','is_recommend', 'province_id', 'city_id', 'district_id', 'mch_common_cat_id', 'transfer_rate', 'sort', 'created_at', 'updated_at', 'province_id', 'city_id', 'district_id','is_open', 'is_lock'], 'integer'], [['logo', 'header_bg', 'name', 'address'], 'string'], [['account_money'], 'number'], [['realname', 'tel', 'name', 'wechat_name', 'longitude', 'latitude', 'main_content', 'summary', 'business', 'card_front', 'card_obverse', 'business_hours'], 'string', 'max' => 255], [['address', 'service_tel'], 'string', 'max' => 1000], [['is_delete', 'account_money', 'longitude', 'latitude'], 'default', 'value'=>0], [['main_content'], 'default', 'value'=>''], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'user_id' => 'User ID', 'is_delete' => 'Is Delete', 'is_open' => '是否营业:0=否,1=是', 'is_recommend' => '是否推荐:0=否,1=是', 'is_lock' => '是否被系统关闭:0=否,1=是', 'realname' => 'Realname', 'tel' => 'Tel', 'name' => 'Name', 'province_id' => 'Province ID', 'city_id' => 'City ID', 'district_id' => 'District ID', 'address' => 'Address', 'mch_common_cat_id' => '所售类目', 'service_tel' => '客服电话', 'logo' => 'logo', 'header_bg' => '背景图', 'transfer_rate' => '商户手续费', 'account_money' => '商户余额', 'sort' => '排序:升序', 'wechat_name' => '微信号', 'longitude' => '经度', 'latitude' => '纬度', 'main_content' => '主营内容', 'summary' => '简介', 'business' => '营业执照', 'card_front' => '身份证正面', 'card_obverse' => '身份证反面', 'business_hours' => '营业时间', 'created_at' => '创建时间', 'updated_at' => '更新时间', ]; } public function getSetting() { return $this->hasOne(MchSetting::className(), ['mch_id' => 'id']); } // // public function getPlugin() // { // return $this->hasOne(MchPlugin::className(), ['mch_id' => 'id']); // } public function getUser() { return $this->hasOne(User::className(), ['id' => 'user_id']); } public function getOrder() { return $this->hasMany(Order::className(), ['mch_id' => 'id']); } public function getGoods() { return $this->hasMany(Goods::className(), ['mch_id' => 'id']); } }