正在显示
1 个修改的文件
包含
8 行增加
和
4 行删除
@@ -2089,12 +2089,16 @@ function birthday_old($id){ | @@ -2089,12 +2089,16 @@ function birthday_old($id){ | ||
2089 | function id_xueshi($id){ | 2089 | function id_xueshi($id){ |
2090 | $name = Db::name('yuyue') | 2090 | $name = Db::name('yuyue') |
2091 | ->where(['uid'=>$id,'status'=>'3']) | 2091 | ->where(['uid'=>$id,'status'=>'3']) |
2092 | - ->count(); | ||
2093 | - return $name; | 2092 | + ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ') |
2093 | + ->select(); | ||
2094 | + $yyxs = $name ? $name['yyxs'] : 0; | ||
2095 | + return $yyxs; | ||
2094 | } | 2096 | } |
2095 | function tid_xueshi($id){ | 2097 | function tid_xueshi($id){ |
2096 | $name = Db::name('yuyue') | 2098 | $name = Db::name('yuyue') |
2097 | ->where(['teach_id'=>$id,'status'=>'3']) | 2099 | ->where(['teach_id'=>$id,'status'=>'3']) |
2098 | - ->count(); | ||
2099 | - return $name; | 2100 | + ->field(' SUM(yuyue_end - yuyue_begin) as yyxs ') |
2101 | + ->select(); | ||
2102 | + $yyxs = $name ? $name['yyxs'] : 0; | ||
2103 | + return $yyxs; | ||
2100 | } | 2104 | } |
-
请 注册 或 登录 后发表评论