|
@@ -36,14 +36,13 @@ class Core
|
|
|
|
|
|
public function __construct()
|
|
public function __construct()
|
|
{
|
|
{
|
|
- $this->checkCode();
|
|
|
|
# 获取当前的用户信息
|
|
# 获取当前的用户信息
|
|
$this->token = Dever::input('token');
|
|
$this->token = Dever::input('token');
|
|
- $this->uid = 1;
|
|
|
|
- $this->share_uid = 1;
|
|
|
|
|
|
+ $this->uid = 2;
|
|
$this->user = $this->getUser($this->uid, $this->id);
|
|
$this->user = $this->getUser($this->uid, $this->id);
|
|
$this->user['id'] = $this->uid;
|
|
$this->user['id'] = $this->uid;
|
|
$this->system_source = Dever::input('system_source', 1);
|
|
$this->system_source = Dever::input('system_source', 1);
|
|
|
|
+ $this->checkCode();
|
|
}
|
|
}
|
|
|
|
|
|
# 获取用户信息
|
|
# 获取用户信息
|
|
@@ -90,7 +89,6 @@ class Core
|
|
unset($info['udate']);
|
|
unset($info['udate']);
|
|
unset($info['state']);
|
|
unset($info['state']);
|
|
unset($info['cdate']);
|
|
unset($info['cdate']);
|
|
- unset($info['score_id']);
|
|
|
|
unset($info['score_type']);
|
|
unset($info['score_type']);
|
|
unset($info['score_name']);
|
|
unset($info['score_name']);
|
|
$info['id_code'] = Dever::encode($info['id'], $this->key);
|
|
$info['id_code'] = Dever::encode($info['id'], $this->key);
|
|
@@ -103,7 +101,7 @@ class Core
|
|
$this->checkInfo();
|
|
$this->checkInfo();
|
|
}
|
|
}
|
|
if ($this->info['buy'] == 1) {
|
|
if ($this->info['buy'] == 1) {
|
|
- # 收费 从订单中读取是否已经购买
|
|
|
|
|
|
+ # 收费 获取是否已经拥有
|
|
$this->info['buy_data'] = Dever::load('user/lib/collection')->check($this->uid, $this->info['id']);
|
|
$this->info['buy_data'] = Dever::load('user/lib/collection')->check($this->uid, $this->info['id']);
|
|
return $this->info['buy_data'] ? true : false;
|
|
return $this->info['buy_data'] ? true : false;
|
|
} else {
|
|
} else {
|
|
@@ -145,10 +143,13 @@ class Core
|
|
$this->id = Dever::decode($this->id_code, $this->key);
|
|
$this->id = Dever::decode($this->id_code, $this->key);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if ($this->share_uid == $this->uid) {
|
|
|
|
+ $this->share_uid = 0;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
# 获取邀请码
|
|
# 获取邀请码
|
|
- protected function getCode($id, $parent_page_id, $page_id, $index, $times_id, $day = 0, $uid = 0)
|
|
|
|
|
|
+ protected function getCode($id, $parent_page_id, $page_id, $index, $times_id, $day = 0, $uid = 0, $ticket_id = 0)
|
|
{
|
|
{
|
|
if (Dever::project('invite')) {
|
|
if (Dever::project('invite')) {
|
|
$invite = Dever::input('invite');
|
|
$invite = Dever::input('invite');
|
|
@@ -168,7 +169,7 @@ class Core
|
|
$day = 0;
|
|
$day = 0;
|
|
}
|
|
}
|
|
|
|
|
|
- $key = 'dlv1_' . $id. '_' . $parent_page_id . '_' . $page_id . '_' . $index . '_' . $times_id . '_' . $day . '_' . $uid;
|
|
|
|
|
|
+ $key = 'dlv1_' . $id. '_' . $parent_page_id . '_' . $page_id . '_' . $index . '_' . $times_id . '_' . $day . '_' . $uid . '_' . $ticket_id;
|
|
|
|
|
|
$code = Dever::encode($key, $this->key);
|
|
$code = Dever::encode($key, $this->key);
|
|
|
|
|
|
@@ -207,8 +208,14 @@ class Core
|
|
$day = 0;
|
|
$day = 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ # 获取门票
|
|
|
|
+ $ticket = Dever::load('user/lib/ticket')->check($this->uid, $this->id);
|
|
|
|
+ if ($ticket) {
|
|
|
|
+ $this->ticket_id = $ticket['id'];
|
|
|
|
+ }
|
|
|
|
+
|
|
# 获取code
|
|
# 获取code
|
|
- $code = $this->getCode($this->id, $parent_page_id, $page_id, $index, $times, $day, $this->uid);
|
|
|
|
|
|
+ $code = $this->getCode($this->id, $parent_page_id, $page_id, $index, $times, $day, $this->uid, $this->ticket_id);
|
|
|
|
|
|
return $code;
|
|
return $code;
|
|
}
|
|
}
|