作者 xiaohu thinkpad

统计学时问题修复

... ... @@ -406,10 +406,16 @@ class YuyueController extends UserBaseController
->select()
->toArray();
// $yyxs = Db::name('yuyue')
// ->where(['uid' => $id, 'status' => 3])
// ->count();
// $yyxs = $yyxs ? $yyxs : 0;
$yyxs = Db::name('yuyue')
->where(['uid' => $id, 'status' => 3])
->count();
$yyxs = $yyxs ? $yyxs : 0;
->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
->select()->toArray();
$yyxs = $yyxs ? $yyxs[0]['yyxs'] : '0';
$this->assign("data", $data);
$this->assign("yyxs", $yyxs);
... ... @@ -483,10 +489,16 @@ class YuyueController extends UserBaseController
->select()
->toArray();
$yjxs = Db::name('yuyue')
// $yjxs = Db::name('yuyue')
// ->where(['teach_id' => $id, 'status' => 3])
// ->count();
// $yjxs = $yjxs ? $yjxs : 0;
$yyxs = Db::name('yuyue')
->where(['teach_id' => $id, 'status' => 3])
->count();
$yjxs = $yjxs ? $yjxs : 0;
->field(' SUM(yuyue_end - yuyue_begin) as yyxs ')
->select()->toArray();
$yjxs = $yyxs ? $yyxs[0]['yyxs'] : '0';
$this->assign("data", $data);
$this->assign("data1", $data1);
... ...