TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'] ] ] ]; } const IS_DELETE_YES = 1;//已删除 const IS_DELETE_NO = 0;//未删除 const SHOP_AUDIT_YES = 1;// 审核通过 const SHOP_AUDIT_NO = -1;// 审核拒绝 const SHOP_AUDIT_WAIT = 0;// 等待审核 /** * @inheritdoc */ public function rules() { return [ [['store_id', 'is_delete', 'score', 'is_default', 'province', 'city', 'district', 'user_id', 'shop_audit'], 'integer'], [['longitude', 'latitude', 'cover_url', 'pic_url', 'content'], 'string'], [['name', 'mobile', 'address', 'shop_time', 'refuse_desc'], 'string', 'max' => 255], [['created_at'], 'safe'] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => 'Store ID', 'user_id' => '用户id', 'name' => 'Name', 'mobile' => 'Mobile', 'address' => 'Address', 'is_delete' => 'Is Delete', 'created_at' => '添加时间', 'longitude' => 'Longitude', 'latitude' => 'Latitude', 'score' => '评分 1~5', 'cover_url' => '自提点大图', 'pic_url' => '自提点小图', 'shop_time' => '营业时间', 'content' => '自提点介绍', 'is_default' => '是否设为默认 0--否 1--是 (只能设置一个自提点为默认自提点)', 'province' => '省份', 'city' => '城市', 'district' => '区县', 'shop_audit' => '审核状态(-1未通过,0待审核,1通过)', 'refuse_desc' => '拒接原因', ]; } // public function getShopPic() // { // return $this->hasMany(ShopPic::className(), ['shop_id'=>'id'])->where(['is_delete'=>0]); // } }