当前位置:网站首页>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();
reference :( Exception please contact to delete )
https://jingyan.baidu.com/article/90808022fab5dbfd91c80f35.html
边栏推荐
- Add, delete, modify and query curd in PHP native SQL
- In the matter of getting customers at sea, how can advertisers play besides digital advertising?
- [Flink] Flink source code analysis - creation of jobgraph in batch mode
- go语言泛型在IDE中语法报错
- SQL related knowledge - DQL
- After a test of 25K bytes, I really saw the basic ceiling
- Nailing open platform - applet development practice (nailing applet server side)
- 六、项目实战---识别猫和狗
- What preparations should be made to develop an app from scratch
- win10 系统打开的软件太小,如何变大(亲测有效)
猜你喜欢

Threejs专用天空盒素材,五种天空盒素材免费下载

Yolov5 improvements: replace the backbone

CTF PHP audit bypasses filtering learning from topics

What should I do if the 51 SCM board cannot find the device in keil

How much do you make by writing a technical book? To tell you the truth, 2million is easy!

pip 批量完全卸载包

软件调试测试的十大重要基本准则

Ten important basic principles of software debugging and testing

钉钉开放平台-小程序开发实战(钉钉小程序客户端)

Using jsup to extract images from interfaces
随机推荐
钉钉开放平台-小程序开发实战(钉钉小程序客户端)
pip 批量完全卸载包
But the Internet began to have a new evolution and began to appear in a new state
English version of ternary loss
High performance computing center roce overview
[Qunhui] Internet access + custom port
VHDL设计
Double buffer technology asynchronous log system
I/o virtualization technology - vfio
How does virtual box virtual machine software accelerate the network speed in the virtual system?
Clickhouse stand alone installation
ipvs之ipvs0网卡
Sorting out the examination sites of the 13th Blue Bridge Cup single chip microcomputer objective questions
解析JSON接口并批量插入到数据库中
微软禁止俄用户下载安装Win10/11
Knowledge of SQL - database design, backup and restore
[Flink] a brief analysis of the writing process of Flink sort shuffle
The open software of win10 system is too small. How to make it larger (effective through personal test)
In 2022, what professional competitions can college students majoring in automation, electrical engineering and automation participate in?
[Qunhui] no port access (reverse proxy + intranet penetration)