瀏覽代碼

列表加入 nickname

visuddhinanda 4 年之前
父節點
當前提交
b34e8f072d
共有 2 個文件被更改,包括 12 次插入5 次删除
  1. 8 4
      app/uwbw/wbw_channal_list.js
  2. 4 1
      app/uwbw/wbw_channel_list.php

+ 8 - 4
app/uwbw/wbw_channal_list.js

@@ -8,7 +8,8 @@ function wbw_channal_list_init() {
 	);
 	$("#wbw_channal_list_dlg").dialog({
 		autoOpen: false,
-		width: 550,
+		width: 700,
+		height:650,
 		buttons: [
 			{
 				text: gLocal.gui.cancel,
@@ -34,7 +35,7 @@ function wbw_channal_list_open(book, paralist) {
 				for (let index = 0; index < _wbw_channel.data.length; index++) {
 					const element = _wbw_channel.data[index];
 					html += "<div style='display:flex;line-height: 2.5em;border-bottom: 1px solid gray;'>";
-					html += "<span style='flex:4'>";
+					html += "<span style='flex:3'>";
 					let style = "";
 					let text = "";
 					if (parseInt(element.wbw_para) > 0) {
@@ -60,7 +61,7 @@ function wbw_channal_list_open(book, paralist) {
 					html += "</span>";
 					html += "<span  style='flex:1'>" + (index + 1) + "</span>";
 					html += "<span style='flex:5'>" + element.name + "</span>";
-					html += "<span style='flex:1'>";
+					html += "<span style='flex:2'>";
 					let power = [
 						{ id: 10, note: "查看者" },
 						{ id: 20, note: "编辑者" },
@@ -72,7 +73,10 @@ function wbw_channal_list_open(book, paralist) {
 						}
 					}
 					html += "</span>";
-					html += "<span style='flex:2'>" + element.lang + "</span>";
+					html += "<span style='flex:2'>";
+					html += element.user.nickname;
+					html += "</span>";
+					html += "<span style='flex:1;text-align: right;'>" + element.lang + "</span>";
 					html += "<span style='flex:2;display:none;'>" + element.wbw_para + "/" + element.count + "</span>";
 					html += "</div>";
 				}

+ 4 - 1
app/uwbw/wbw_channel_list.php

@@ -4,6 +4,7 @@ require_once "../public/_pdo.php";
 require_once "../public/function.php";
 require_once '../share/function.php';
 require_once '../channal/function.php';
+require_once '../ucenter/function.php';
 require_once '../redis/function.php';
 
 $redis = redis_connect();
@@ -30,7 +31,7 @@ $params[] = $_book;
 
 #查重复
 $channelList = array();
-
+#先查自己的
 PDO_Connect(_FILE_DB_CHANNAL_);
 $query = "SELECT id FROM channal WHERE owner = ? and status>0 LIMIT 0,100";
 $FetchChannal = PDO_FetchAll($query, array($_COOKIE["userid"]));
@@ -66,6 +67,7 @@ foreach ($publicChannel as $key => $channel) {
 }
 
 $channelInfo = new Channal($redis);
+$userInfo = new UserInfo();
 $i = 0;
 $outputData = array();
 
@@ -81,6 +83,7 @@ foreach ($channelList as $key => $row) {
     $channelList[$key]["id"] = $info["id"];
     $channelList[$key]["name"] = $info["name"];
     $channelList[$key]["lang"] = $info["lang"];
+	$channelList[$key]["user"] = $userInfo->getName($info["owner"]);
 	$outputData[]=$channelList[$key];
 }