作者 xiaohu thinkpad

统计学时问题修复

... ... @@ -37,7 +37,7 @@ class ProfileController extends UserBaseController
->where(['teach_id' => $uid, 'status' => 3])
->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
->select()->toArray();
$yyxs = $yyxs ? $yyxs['yyxs'] : 0;
$yyxs = $name ? $name[0]['yyxs'] : '0';
$this->assign("yyxs", $yyxs);
return $this->fetch('percenter_coach');
} else {
... ... @@ -45,7 +45,7 @@ class ProfileController extends UserBaseController
->where(['uid' => $uid, 'status' => 3])
->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
->select()->toArray();
$yyxs = $yyxs ? $yyxs['yyxs'] : 0;
$yyxs = $name ? $name[0]['yyxs'] : '0';
$this->assign("yyxs", $yyxs);
return $this->fetch('percenter_stu');
}
... ...
... ... @@ -10,7 +10,7 @@
// [ 入口文件 ]
date_default_timezone_set('Asia/Shanghai');
// 调试模式开关
define("APP_DEBUG", 1);
define("APP_DEBUG", 0);
// 定义CMF根目录,可更改此目录
define('CMF_ROOT', __DIR__ . '/../');
... ...
... ... @@ -2093,7 +2093,7 @@ function id_xueshi($id){
->select()->toArray();
// return Db::name('yuyue')->getLastSql();
// return json_encode($name,true) ;
$yyxs = $name ? $name[0]['yyxs'] : 0;
$yyxs = $name ? $name[0]['yyxs'] : '0';
return $yyxs;
}
function tid_xueshi($id){
... ... @@ -2101,6 +2101,6 @@ function tid_xueshi($id){
->where(['teach_id'=>$id,'status'=>'3'])
->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
->select()->toArray();
$yyxs = $name ? $name['yyxs'] : 0;
$yyxs = $name ? $name[0]['yyxs'] : '0';
return $yyxs;
}
\ No newline at end of file
... ...