70 lines
1.7 KiB
PHP
70 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace common\modelsgii;
|
|
|
|
use Yii;
|
|
|
|
/**
|
|
* This is the model class for table "yii_address".
|
|
*
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property string $name
|
|
* @property string $mobile
|
|
* @property string $province 省
|
|
* @property string $city 市
|
|
* @property string $area 区
|
|
* @property string $region 省市区
|
|
* @property string $detail_address 详细地址
|
|
* @property int $is_default 是否默认地址0否1是
|
|
* @property int $created_at
|
|
* @property int $updated_at
|
|
* @property int $is_delete
|
|
*/
|
|
class Address extends \common\core\BaseActiveRecord
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function tableName()
|
|
{
|
|
return 'yii_address';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['user_id'], 'required'],
|
|
[['user_id', 'is_default', 'created_at', 'updated_at', 'is_delete'], 'integer'],
|
|
[['name'], 'string', 'max' => 150],
|
|
[['mobile'], 'string', 'max' => 20],
|
|
[['region', 'province','detail_address'], 'string', 'max' => 255],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'id' => 'ID',
|
|
'user_id' => 'User ID',
|
|
'name' => 'Name',
|
|
'mobile' => 'Mobile',
|
|
'province' => 'Province',
|
|
'city' => 'city',
|
|
'area' => 'area',
|
|
'region' => 'Region',
|
|
'detail_address' => 'Detail Address',
|
|
'is_default' => 'Is Default',
|
|
'created_at' => 'Created At',
|
|
'updated_at' => 'Updated At',
|
|
'is_delete' => 'Is Delete',
|
|
];
|
|
}
|
|
}
|