cxfoot/models/Store.php
2023-10-27 14:25:12 +08:00

99 lines
2.9 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "{{%store}}".
*
* @property int $id
* @property string $name 门店名称
* @property string $province 省
* @property int $province_id 省ID
* @property string $city 市
* @property int $city_id 市ID
* @property string $region 区
* @property int $region_id 区ID
* @property string $location_detail 门店具体位置
* @property int $begin_time 营业开始时间
* @property int $end_time 营业结束时间
* @property int $status 1-营业 0-停业
* @property string $sort 排序
* @property int $created_at 添加时间
* @property int|null $updated_at 修改时间
* @property int $is_delete 是否删除0=否1=是
* @property int $deleted_at 删除时间
* @property int|null $ratio 收益比例
* @property string|null $lat 纬度
* @property string|null $lng 经度
* @property string|null $phone 客服电话
*/
class Store extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return '{{%store}}';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['name', 'province', 'province_id', 'city', 'city_id', 'region', 'region_id', 'location_detail', 'begin_time', 'end_time'], 'required'],
[['province_id', 'city_id', 'region_id', 'status', 'created_at', 'updated_at', 'is_delete', 'deleted_at','ratio'], 'integer'],
[['name', 'sort'], 'string', 'max' => 50],
[['phone'], 'string', 'max' => 20],
[['province', 'city', 'region','begin_time','end_time','lat','lng'], 'string', 'max' => 20],
[['location_detail'], 'string', 'max' => 255],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'name' => '门店名称',
'province' => '省',
'province_id' => '省ID',
'city' => '市',
'city_id' => '市ID',
'region' => '区',
'region_id' => '区ID',
'location_detail' => '门店具体位置',
'begin_time' => '营业开始时间',
'end_time' => '营业结束时间',
'status' => '1-营业 0-停业',
'sort' => '排序',
'created_at' => '添加时间',
'updated_at' => '修改时间',
'is_delete' => '是否删除0=否1=是',
'deleted_at' => '删除时间',
'ratio' => '收益比例',
'lat' => '纬度',
'lng' => '经度',
'phone' => '客服电话',
];
}
public static function statusLabels()
{
return [
'0' => '待租',
'1' => '租赁',
'2' => '停用',
];
}
}