|
@@ -19,7 +19,6 @@ class Core
|
|
|
protected $parent_page_id;
|
|
|
protected $page_id;
|
|
|
protected $info;
|
|
|
- protected $key = '';
|
|
|
/*
|
|
|
# 定义全局的系统类型
|
|
|
'system_source' => array
|
|
@@ -45,12 +44,6 @@ class Core
|
|
|
$this->system_source = Dever::input('system_source', 1);
|
|
|
}
|
|
|
|
|
|
- protected function key()
|
|
|
- {
|
|
|
- $this->key = Dever::config('base', 'project')->encode_key;
|
|
|
- return $this->key;
|
|
|
- }
|
|
|
-
|
|
|
# 获取用户信息
|
|
|
protected function getUser($uid, $collection_id)
|
|
|
{
|
|
@@ -97,7 +90,7 @@ class Core
|
|
|
unset($info['cdate']);
|
|
|
unset($info['score_type']);
|
|
|
unset($info['score_name']);
|
|
|
- $this->id_code = $info['id_code'] = Dever::encode($info['id'], $this->key());
|
|
|
+ $this->id_code = $info['id_code'] = Dever::load('collection/lib/common')->encode($info['id']);
|
|
|
}
|
|
|
|
|
|
# 检查是否可以查看
|
|
@@ -124,7 +117,7 @@ class Core
|
|
|
{
|
|
|
$this->code = Dever::input('code');
|
|
|
if ($this->code) {
|
|
|
- $code = Dever::decode($this->code, $this->key());
|
|
|
+ $code = Dever::load('collection/lib/common')->decode($this->code);
|
|
|
$code = explode('_', $code);
|
|
|
$this->id = $code[1];
|
|
|
$this->parent_page_id = $code[2];
|
|
@@ -150,7 +143,7 @@ class Core
|
|
|
if ($this->id_code == -1) {
|
|
|
$this->id = $this->id_code;
|
|
|
} else {
|
|
|
- $this->id = Dever::decode($this->id_code, $this->key());
|
|
|
+ $this->id = Dever::load('collection/lib/common')->decode($this->id_code);
|
|
|
}
|
|
|
}
|
|
|
if ($this->share_uid == $this->uid) {
|
|
@@ -159,7 +152,7 @@ class Core
|
|
|
}
|
|
|
|
|
|
# 获取邀请码
|
|
|
- protected function getCode($id, $parent_page_id, $page_id, $index, $times_id, $day = 0, $uid = 0, $ticket_id = 0)
|
|
|
+ protected function getCode($id, $parent_page_id, $page_id, $index, $times_id, $day = 0, $uid = 0, $ticket_id = 0, $encode = true)
|
|
|
{
|
|
|
if (Dever::project('invite')) {
|
|
|
$invite = Dever::input('invite');
|
|
@@ -179,12 +172,30 @@ class Core
|
|
|
$day = 0;
|
|
|
}
|
|
|
|
|
|
- $key = 'dlv1_' . $id. '_' . $parent_page_id . '_' . $page_id . '_' . $index . '_' . $times_id . '_' . $day . '_' . $uid . '_' . $ticket_id;
|
|
|
- $code = Dever::encode($key, $this->key());
|
|
|
+ $code = 'dlv1_' . $id. '_' . $parent_page_id . '_' . $page_id . '_' . $index . '_' . $times_id . '_' . $day . '_' . $uid . '_' . $ticket_id;
|
|
|
+
|
|
|
+ if ($encode) {
|
|
|
+ $code = Dever::load('collection/lib/common')->encode($code);
|
|
|
+ }
|
|
|
|
|
|
return $code;
|
|
|
}
|
|
|
|
|
|
+ #获取短域名
|
|
|
+ public function getUrl($url, $param)
|
|
|
+ {
|
|
|
+ if (Dever::project('short')) {
|
|
|
+ # 转成短域名
|
|
|
+ if (isset($param['code']) && $param['code']) {
|
|
|
+ $param['code'] .= '|collection/lib/common.encode';
|
|
|
+ }
|
|
|
+ $url = Dever::load('short/lib/handle')->get(1, $url, $param);
|
|
|
+ } else {
|
|
|
+ $url .= http_build_query($param);
|
|
|
+ }
|
|
|
+ return $url;
|
|
|
+ }
|
|
|
+
|
|
|
protected function getInfoCode()
|
|
|
{
|
|
|
# 获取最新的用户记录
|