|
@@ -35,22 +35,14 @@ class User extends Model
|
|
|
return isset($list['name']) ? $list['name'] : '';
|
|
|
}
|
|
|
|
|
|
- public function getConstellationTextAttr($value, $data)
|
|
|
- {
|
|
|
- $value = $value ? $value : (isset($data['constellation_id']) ? $data['constellation_id'] : 0);
|
|
|
- $list = [];
|
|
|
- if (!empty($value)) {
|
|
|
- $list = model('Constellation')->field('name')->find($value);
|
|
|
- }
|
|
|
- return isset($list['name']) ? $list['name'] : '';
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
public function getJobTextAttr($value, $data)
|
|
|
{
|
|
|
$value = $value ? $value : (isset($data['job_id']) ? $data['job_id'] : 0);
|
|
|
$list = [];
|
|
|
if (!empty($value)) {
|
|
|
- $list = model('enumjob')->field('name')->find($value);
|
|
|
+ $list = model('Enumjob')->field('name')->find($value);
|
|
|
}
|
|
|
return isset($list['name']) ? $list['name'] : '';
|
|
|
}
|
|
@@ -217,65 +209,6 @@ class User extends Model
|
|
|
return $value;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取用户贵族信息
|
|
|
- */
|
|
|
- public static function getUserNoble($user_id) {
|
|
|
- $result = [];
|
|
|
- $result["noble_on"] = 0;
|
|
|
- $nobleInfo = self::alias("a")
|
|
|
- ->field("a.noble,n.level_no,a.noble_duetime,n.explain")
|
|
|
- ->join("hx_noble_level n","a.noble = n.id")
|
|
|
- ->where(["a.id"=>$user_id])->find();
|
|
|
-
|
|
|
- if($nobleInfo && $nobleInfo["noble_duetime"] > time()) {
|
|
|
- $result["noble_on"] = 1;
|
|
|
- $result["noble"] = $nobleInfo["noble"];
|
|
|
- $result["explain"] = $nobleInfo["explain"];
|
|
|
- $result["level_no"] = $nobleInfo["level_no"] ? $nobleInfo["level_no"] : "";
|
|
|
- $result["noble_duetime"] = date("Y-m-d H:i:s", $nobleInfo["noble_duetime"]);
|
|
|
- }
|
|
|
-
|
|
|
- return $result;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取用户贵族开通信息
|
|
|
- */
|
|
|
- public function getUserNobleInfo($user_id) {
|
|
|
- $result = [];
|
|
|
- $result["noble_on"] = 0;
|
|
|
- $result["noble"] = 0;
|
|
|
- $result["noble_txt"] = "";
|
|
|
- $result["noble_duetime"] = 0;
|
|
|
- $nobleInfo = $this->alias("a")
|
|
|
- ->field("a.noble,n.level_no,a.noble_duetime,n.name,n.back_image,n.icon_image,n.jctx,n.tqgq,n.lxrys,n.zlys,n.diylw,n.fjft,n.zdych")
|
|
|
- ->join("hx_noble_level n","a.noble = n.id")
|
|
|
- ->where(["a.id"=>$user_id])->find();
|
|
|
- if($nobleInfo) {
|
|
|
- if($nobleInfo["noble_duetime"] > time()) {
|
|
|
- $result["noble_on"] = 1;
|
|
|
- $result["noble"] = $nobleInfo["noble"];
|
|
|
- $result["level_no"] = $nobleInfo["level_no"]?$nobleInfo["level_no"]:"";
|
|
|
- $result["noble_txt"] = $nobleInfo["name"]?$nobleInfo["name"]:"";
|
|
|
-// $result["noble_back_image"] = $nobleInfo["back_image"];
|
|
|
- $result["noble_icon_image"] = $nobleInfo["icon_image"]?$nobleInfo["icon_image"]:"";
|
|
|
- $result["noble_jctx"] = $nobleInfo["jctx"]?$nobleInfo["jctx"]:"";
|
|
|
-// $result["noble_tqgq"] = $nobleInfo["tqgq"];
|
|
|
- $result["noble_lxrys"] = $nobleInfo["lxrys"]?$nobleInfo["lxrys"]:"";
|
|
|
- $result["noble_zlys"] = $nobleInfo["zlys"]?$nobleInfo["zlys"]:"";
|
|
|
- $result["noble_diylw"] = $nobleInfo["diylw"]?$nobleInfo["diylw"]:"";
|
|
|
- $result["noble_fjft"] = $nobleInfo["fjft"]?$nobleInfo["fjft"]:"";
|
|
|
- $result["noble_zdych"] = $nobleInfo["zdych"]?$nobleInfo["zdych"]:"";
|
|
|
- $result["noble_duetime"] = date("Y-m-d H:i:s",$nobleInfo["noble_duetime"]);
|
|
|
- } else {
|
|
|
- $result["noble"] = $nobleInfo["noble"];
|
|
|
- $result["noble_txt"] = $nobleInfo["name"]?$nobleInfo["name"]:"";
|
|
|
- $nobleInfo["noble"] > 0 && $result["noble_duetime"] = -1; // 已到期
|
|
|
- }
|
|
|
- }
|
|
|
- return $result;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 增加魅力等级
|
|
@@ -404,6 +337,7 @@ class User extends Model
|
|
|
$userInfo['job_text'] = $this->getJobTextAttr(false,['job_id' => $userInfo['job_id']]);
|
|
|
$userInfo['age_text'] = $this->getAgeTextAttr(false,['age_id' => $ageId]);
|
|
|
$areaWhere['id'] = ['in',[$provinceId,$cityId]];
|
|
|
+
|
|
|
$areaData = Db::name('shopro_area')->where($areaWhere)->column('id,name');
|
|
|
$userInfo['province_text'] = isset($areaData[$provinceId]) ? $areaData[$provinceId] : '';
|
|
|
$userInfo['city_text'] = isset($areaData[$cityId]) ? $areaData[$cityId] : '';
|
|
@@ -423,7 +357,7 @@ class User extends Model
|
|
|
}
|
|
|
public function job()
|
|
|
{
|
|
|
- return $this->hasOne('EnumJob', 'id', 'job_id',[],'LEFT');
|
|
|
+ return $this->hasOne('Enumjob', 'id', 'job_id',[],'LEFT');
|
|
|
}
|
|
|
public function useralipay()
|
|
|
{
|