Explorar el Código

修改权限管理列表页面展示关联账号

lvhao hace 3 semanas
padre
commit
ae63f9811c
Se han modificado 2 ficheros con 21 adiciones y 5 borrados
  1. 15 1
      core/CoreApp/controllers/Power.php
  2. 6 4
      template/erp/power.html

+ 15 - 1
core/CoreApp/controllers/Power.php

@@ -66,10 +66,24 @@ class Power extends Start_Controller {
 			}
             //取得信息列表
             $info_list = $this->power->find_all($where,'id,powername,title,powertext,exceltext',$order_str,$start,$perpage);
+            $final_list = [];
+            foreach ($info_list as $key => $value) {
+                $user_list = $this->user->find_all('power = "'.$value['id'].'" ' );
+                $final_list[$key]['id'] = $value['id'];
+                $final_list[$key]['powername'] = $value['powername'];
+                $str = '';
+                foreach ($user_list as $k => $v) {
+                    $str.= "<p>".$v['userid'].'</p>';
+                }
+                $final_list[$key]['user_list'] = $str;
+                $final_list[$key]['title'] = $value['title'];
+                $final_list[$key]['powertext'] = $value['powertext'];
+                $final_list[$key]['exceltext'] = $value['exceltext'];
+            }
 		    $total = $this->power->find_count($where);
 		    $pagenum = ceil($total/$perpage);
 		    $over = $total-($start+$perpage);
-		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));
+		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($final_list));
 		    echo json_encode($rows);exit;
 		}
 		$power = $this->power->find_all();

+ 6 - 4
template/erp/power.html

@@ -66,6 +66,7 @@
 <tr>
 <td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
 <td>权限名称</td>
+<td>关联账号</td>
 <td>备注</td>
 <td>权限</td>
 <td>可用下载</td>
@@ -85,10 +86,11 @@ var customon = 1;
 function custom(){
 $(".data tr").each(function() {
 $(this).find('td:eq(0)').css("width","1%");
-$(this).find('td:eq(1)').css("width","11%");
-$(this).find('td:eq(2)').css("width","20%");
-$(this).find('td:eq(3)').css("width","38%");
-$(this).find('td:eq(4)').css("width","30%");
+$(this).find('td:eq(1)').css("width","6%");
+$(this).find('td:eq(2)').css("width","6%");
+$(this).find('td:eq(3)').css("width","20%");
+$(this).find('td:eq(4)').css("width","38%");
+$(this).find('td:eq(5)').css("width","29%");
 });}