当前位置:网站首页>The statistics in the MySQL field become strings, and then they are converted into numbers for sorting

The statistics in the MySQL field become strings, and then they are converted into numbers for sorting

2022-06-26 04:18:00 Summer solstice and spring - Meimei

if ($sort){
$order = ‘totle_hours asc’;
}else{
$order = ‘totle_hours desc’;
}
d a t a [ ′ d a t a ′ ] = ( n e w S t u d e n t P u n c h C a r d ( ) ) − > a l i a s ( ′ s ′ ) − > l e f t J o i n ( ′ h i s i c h i l d r e n c ′ , ′ c . i d = s . c i d ′ ) − > l e f t J o i n ( ′ h i s i u s e r u ′ , ′ u . i d = c . u i d ′ ) − > l e f t J o i n ( ′ h i s i d e m e n t g r o u p d ′ , ′ d . i d = c . s c h o o l i d ′ ) − > l e f t J o i n ( ′ h i s i s c h o o l m o n e y m ′ , ′ m . i d = c . c l a s s i d ′ ) − > w h e r e ( data['data'] = (new StudentPunchCard())->alias('s') ->leftJoin('hisi_children c','c.id = s.cid') ->leftJoin('hisi_user u','u.id = c.uid') ->leftJoin('hisi_dementgroup d','d.id = c.schoolid') ->leftJoin('hisi_schoolmoney m','m.id = c.class_id') ->where( data[data]=(newStudentPunchCard())>alias(s)>leftJoin(hisichildrenc,c.id=s.cid)>leftJoin(hisiuseru,u.id=c.uid)>leftJoin(hisidementgroupd,d.id=c.schoolid)>leftJoin(hisischoolmoneym,m.id=c.classid)>where(where)
->page( p a g e , page, page,limit)
->group(‘s.cid’)
->field(‘c.name,c.id,c.thumb_tmp,c.class_hour,c.private_class,d.title as schoolname,u.real_name,m.title as cardname,
CAST(sum(s.class_hour) AS UNSIGNED) as totle_hours,u.username’)
->order($order)
->select();
 Insert picture description here

reference :( Exception please contact to delete )
https://jingyan.baidu.com/article/90808022fab5dbfd91c80f35.html

原网站

版权声明
本文为[Summer solstice and spring - Meimei]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180535591867.html