作者 xiaohu thinkpad

统计学时问题修复

@@ -37,7 +37,7 @@ class ProfileController extends UserBaseController @@ -37,7 +37,7 @@ class ProfileController extends UserBaseController
37 ->where(['teach_id' => $uid, 'status' => 3]) 37 ->where(['teach_id' => $uid, 'status' => 3])
38 ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ') 38 ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
39 ->select()->toArray(); 39 ->select()->toArray();
40 - $yyxs = $yyxs ? $yyxs['yyxs'] : 0; 40 + $yyxs = $name ? $name[0]['yyxs'] : '0';
41 $this->assign("yyxs", $yyxs); 41 $this->assign("yyxs", $yyxs);
42 return $this->fetch('percenter_coach'); 42 return $this->fetch('percenter_coach');
43 } else { 43 } else {
@@ -45,7 +45,7 @@ class ProfileController extends UserBaseController @@ -45,7 +45,7 @@ class ProfileController extends UserBaseController
45 ->where(['uid' => $uid, 'status' => 3]) 45 ->where(['uid' => $uid, 'status' => 3])
46 ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ') 46 ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
47 ->select()->toArray(); 47 ->select()->toArray();
48 - $yyxs = $yyxs ? $yyxs['yyxs'] : 0; 48 + $yyxs = $name ? $name[0]['yyxs'] : '0';
49 $this->assign("yyxs", $yyxs); 49 $this->assign("yyxs", $yyxs);
50 return $this->fetch('percenter_stu'); 50 return $this->fetch('percenter_stu');
51 } 51 }
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 // [ 入口文件 ] 10 // [ 入口文件 ]
11 date_default_timezone_set('Asia/Shanghai'); 11 date_default_timezone_set('Asia/Shanghai');
12 // 调试模式开关 12 // 调试模式开关
13 -define("APP_DEBUG", 1); 13 +define("APP_DEBUG", 0);
14 14
15 // 定义CMF根目录,可更改此目录 15 // 定义CMF根目录,可更改此目录
16 define('CMF_ROOT', __DIR__ . '/../'); 16 define('CMF_ROOT', __DIR__ . '/../');
@@ -2093,7 +2093,7 @@ function id_xueshi($id){ @@ -2093,7 +2093,7 @@ function id_xueshi($id){
2093 ->select()->toArray(); 2093 ->select()->toArray();
2094 // return Db::name('yuyue')->getLastSql(); 2094 // return Db::name('yuyue')->getLastSql();
2095 // return json_encode($name,true) ; 2095 // return json_encode($name,true) ;
2096 - $yyxs = $name ? $name[0]['yyxs'] : 0; 2096 + $yyxs = $name ? $name[0]['yyxs'] : '0';
2097 return $yyxs; 2097 return $yyxs;
2098 } 2098 }
2099 function tid_xueshi($id){ 2099 function tid_xueshi($id){
@@ -2101,6 +2101,6 @@ function tid_xueshi($id){ @@ -2101,6 +2101,6 @@ function tid_xueshi($id){
2101 ->where(['teach_id'=>$id,'status'=>'3']) 2101 ->where(['teach_id'=>$id,'status'=>'3'])
2102 ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ') 2102 ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
2103 ->select()->toArray(); 2103 ->select()->toArray();
2104 - $yyxs = $name ? $name['yyxs'] : 0; 2104 + $yyxs = $name ? $name[0]['yyxs'] : '0';
2105 return $yyxs; 2105 return $yyxs;
2106 } 2106 }