|
@@ -6,85 +6,6 @@ use Dever;
|
|
|
|
|
|
class Manage
|
|
|
{
|
|
|
-
|
|
|
- * 显示用户信息
|
|
|
- *
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function showUserInfo($uid, $ldate = false)
|
|
|
- {
|
|
|
- if ($uid) {
|
|
|
- $user = Dever::db('passport/user')->one($uid);
|
|
|
- if ($user) {
|
|
|
- $table = array();
|
|
|
- $table['用户名'] = $user['username'];
|
|
|
- $table['手机号'] = $user['mobile'];
|
|
|
- $table['领取时间'] = date('Y-m-d H:i:s', $ldate);
|
|
|
- return Dever::table($table);
|
|
|
- }
|
|
|
- } else {
|
|
|
- return '';
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 创建兑换码
|
|
|
- *
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function create($id, $name, $data)
|
|
|
- {
|
|
|
- $code = Dever::param('code', $data);
|
|
|
- $type = Dever::param('type', $data);
|
|
|
- $product_id = Dever::param('product_id', $data);
|
|
|
-
|
|
|
- if (!in_array(2, $type)) {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- $total = Dever::db('journal/code')->total(array('product_id' => $product_id,'product_price_id' => $id, 'type' => 1));
|
|
|
- if ($code > 0 && $code > $total) {
|
|
|
- $num = $code - $total;
|
|
|
-
|
|
|
- for ($i = 0; $i < $num; $i++) {
|
|
|
- $this->createCode($product_id, $id);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- private function createCode($product_id, $id)
|
|
|
- {
|
|
|
- $code = Dever::rand(8, 0);
|
|
|
- $data['product_id'] = $product_id;
|
|
|
- $data['product_price_id'] = $id;
|
|
|
- $data['code'] = $code;
|
|
|
- $total = Dever::db('journal/code')->total($data);
|
|
|
- if ($total > 0) {
|
|
|
- return $this->createCode($product_id, $id);
|
|
|
- }
|
|
|
- $data['type'] = 1;
|
|
|
- Dever::db('code/info')->insert($data);
|
|
|
- return $code;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- * 资料审核
|
|
|
- *
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function info_audit($id, $name, $data)
|
|
|
- {
|
|
|
- $info = Dever::db('task/user_info')->one($id);
|
|
|
- $status = Dever::param('status', $data);
|
|
|
- $desc = Dever::param('status_desc', $data);
|
|
|
- if ($info && $status == 3) {
|
|
|
- $uid = $info['uid'];
|
|
|
- $name = '用户认证未通过';
|
|
|
- $content = '原因:' . $desc;
|
|
|
- Dever::load('message/lib/data.push', -1, $uid, $name, $content, 11);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
private function search($table = 'content/article')
|
|
|
{
|
|
|
$keyword = Dever::input('keyword');
|
|
@@ -155,6 +76,29 @@ class Manage
|
|
|
$data[$k]['pic'] = $v['focus'];
|
|
|
}
|
|
|
|
|
|
+ if ($v['type'] == 11) {
|
|
|
+
|
|
|
+ $info = Dever::load('content/lib/article')->get($v['article_id']);
|
|
|
+ if ($info) {
|
|
|
+ $data[$k]['pic'] = $info['pic_cover'];
|
|
|
+ $data[$k]['name'] = $info['name'];
|
|
|
+ }
|
|
|
+ } elseif ($v['type'] == 12) {
|
|
|
+
|
|
|
+ $info = Dever::load('video/lib/vod')->get($v['vod_id']);
|
|
|
+ if ($info) {
|
|
|
+ $data[$k]['pic'] = $info['pic_cover'];
|
|
|
+ $data[$k]['name'] = $info['name'];
|
|
|
+ }
|
|
|
+ } elseif ($v['type'] == 13) {
|
|
|
+
|
|
|
+ $info = Dever::load('video/lib/live')->get($v['live_id']);
|
|
|
+ if ($info) {
|
|
|
+ $data[$k]['pic'] = $info['pic_cover'];
|
|
|
+ $data[$k]['name'] = $info['name'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if ($v['type'] == 2) {
|
|
|
$data[$k]['text'] = $this->text($database, $v['id'], $where['info_id']);
|
|
|
} else {
|
|
@@ -172,31 +116,44 @@ class Manage
|
|
|
return $data;
|
|
|
}
|
|
|
|
|
|
+ private function text_name($link, $content_id, $info_id, $location, $name)
|
|
|
+ {
|
|
|
+ $where['info_id'] = $info_id;
|
|
|
+ $where['content_id'] = $content_id;
|
|
|
+ $where['location'] = $location;
|
|
|
+ $info = Dever::db('journal/content_text')->one($where);
|
|
|
+
|
|
|
+ $link .= '&search_option_info_id=' . $info_id. '&search_option_content_id=' . $content_id.'&table=content_text&search_option_location='.$location;
|
|
|
+
|
|
|
+ if ($info) {
|
|
|
+ $link .= '&where_id=' . $info['id'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $html = '<a style="cursor:pointer;" href="javascript:;" onclick="fastEdit($(this), \''.$link.'\', \'编辑'.$name.'文字\', \'\')">'.$name.'</a>';
|
|
|
+
|
|
|
+ return $html;
|
|
|
+ }
|
|
|
+
|
|
|
public function text($database, $content_id, $info_id)
|
|
|
{
|
|
|
- $id = 1;
|
|
|
- $link = $database->url('edit') . '&search_option_info_id=' . $info_id . '&search_option_content_id=' . $content_id . '&table=content_text&where_id=' . $id;
|
|
|
- $edit =
|
|
|
-
|
|
|
- $html = '<table class="layui-table">
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <td><a href="javascript:;" onclick="fastEdit($(this), \''.$link . '&search_option_location=1'.'\', \'编辑上左文字\', \'\')">上左</a></td>
|
|
|
- <td>上中</td>
|
|
|
- <td>上右</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>中左</td>
|
|
|
- <td>正中</td>
|
|
|
- <td>中右</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td>下左</td>
|
|
|
- <td>下中</td>
|
|
|
- <td>下右</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
-</table>';
|
|
|
+ $link = $database->url('edit');
|
|
|
+
|
|
|
+ $location = Dever::db('journal/content_text')->config['location'];
|
|
|
+
|
|
|
+ $html = '<table class="layui-table"><tbody><tr>';
|
|
|
+ $i = 0;
|
|
|
+ foreach ($location as $k => $v) {
|
|
|
+ $name = $this->text_name($link, $content_id, $info_id, $k, $v);
|
|
|
+ $html .= '<td>'.$name.'</td>';
|
|
|
+
|
|
|
+ if ($i == 2 || $i == 5) {
|
|
|
+ $html .= '</tr><tr>';
|
|
|
+ }
|
|
|
+
|
|
|
+ $i++;
|
|
|
+ }
|
|
|
+
|
|
|
+ $html .= '</tr></tbody></table>';
|
|
|
|
|
|
return $html;
|
|
|
}
|