@@ -25,6 +25,16 @@ class UserModel extends BaseModel
// 设置数据表
protected $table = 'user';
+ protected $appends = ['mobile_text'];
+
+ /**
+ * @return array
+ */
+ public function getmobileTextAttribute()
+ {
+ return $this->mobile? format_mobile($this->mobile):'';
+ }
/**
* 获取数据信息
* @param int $id 用户ID