36 lines
647 B
PHP
36 lines
647 B
PHP
<?php
|
|
|
|
namespace app\common\model;
|
|
|
|
use think\Db;
|
|
use think\Model;
|
|
|
|
/**
|
|
* 邀请模型
|
|
*/
|
|
class Invitation extends Model
|
|
{
|
|
|
|
// 开启自动写入时间戳字段
|
|
protected $autoWriteTimestamp = 'int';
|
|
// 定义时间戳字段名
|
|
protected $createTime = 'createtime';
|
|
protected $updateTime = 'updatetime';
|
|
|
|
|
|
|
|
/**
|
|
* 获取验证字段数组值
|
|
* @param string $value
|
|
* @param array $data
|
|
* @return object
|
|
*/
|
|
public function getVerificationAttr($value, $data)
|
|
{
|
|
$value = array_filter((array)json_decode($value, true));
|
|
$value = array_merge(['mobile' => 0], $value);
|
|
return (object)$value;
|
|
}
|
|
|
|
}
|