mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-23 20:00:27 +08:00
95 lines
1.3 KiB
PHP
95 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class UserContact extends Model
|
|
{
|
|
|
|
/**
|
|
* 用户编号(主键)
|
|
*
|
|
* @var int
|
|
*/
|
|
public $user_id = 0;
|
|
|
|
/**
|
|
* 姓名
|
|
*
|
|
* @var string
|
|
*/
|
|
public $name = '';
|
|
|
|
/**
|
|
* 手机
|
|
*
|
|
* @var string
|
|
*/
|
|
public $phone = '';
|
|
|
|
/**
|
|
* 地址(省)
|
|
*
|
|
* @var string
|
|
*/
|
|
public $add_province = '';
|
|
|
|
/**
|
|
* 地址(市)
|
|
*
|
|
* @var string
|
|
*/
|
|
public $add_city = '';
|
|
|
|
/**
|
|
* 地址(区)
|
|
*
|
|
* @var string
|
|
*/
|
|
public $add_county = '';
|
|
|
|
/**
|
|
* 地址(详)
|
|
*
|
|
* @var string
|
|
*/
|
|
public $add_other = '';
|
|
|
|
/**
|
|
* 创建时间
|
|
*
|
|
* @var int
|
|
*/
|
|
public $create_time = 0;
|
|
|
|
/**
|
|
* 更新时间
|
|
*
|
|
* @var int
|
|
*/
|
|
public $update_time = 0;
|
|
|
|
public function getSource(): string
|
|
{
|
|
return 'kg_user_contact';
|
|
}
|
|
|
|
public function beforeSave()
|
|
{
|
|
if (empty($this->create_time)) {
|
|
$this->create_time = time();
|
|
}
|
|
|
|
$this->update_time = time();
|
|
}
|
|
|
|
public function fullAddress()
|
|
{
|
|
return implode(' ', [
|
|
$this->add_province,
|
|
$this->add_city,
|
|
$this->add_county,
|
|
$this->add_other,
|
|
]);
|
|
}
|
|
|
|
} |