| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- use Yii;
- /**
- * This is the model class for table "{{%shop}}".
- *
- * @property integer $id
- * @property integer $store_id
- * @property integer $user_id
- * @property string $name
- * @property string $mobile
- * @property string $address
- * @property integer $is_delete
- * @property integer $created_at
- * @property string $longitude
- * @property string $latitude
- * @property integer $score
- * @property string $cover_url
- * @property string $pic_url
- * @property string $shop_time
- * @property string $content
- * @property integer $is_default
- * @property int|null $province
- * @property int|null $city
- * @property int|null $district
- * @property int|null $shop_audit 审核状态(-1未通过,0待审核,1通过)
- * @property string|null $refuse_desc 拒接原因
- */
- class Shop extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%shop}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => 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]);
- // }
- }
|