TP3.2.3 求出每年每月详细数据
2016-07-07 19:38
399 查看
//咨询业绩数据源 uid 客服人员ID public function RatingData($uid) { //取出每年12个月 //一月 $January = strtotime( date('Y-01',strtotime(date('Y-m-d'))) ); //二月 $February = date('Y-02',strtotime(date('Y-m-d'))); //三月 $March = date('Y-03',strtotime(date('Y-m-d'))); //四月 $April = date('Y-04',strtotime(date('Y-m-d'))); //五月 $May = date('Y-05',strtotime(date('Y-m-d'))); //六月 $June = date('Y-06',strtotime(date('Y-m-d'))); //七月 $July = strtotime( date('Y-07',strtotime(date('Y-m-d'))) ); //八月 $August = date('Y-08',strtotime(date('Y-m-d'))); //九月 $September = date('Y-09',strtotime(date('Y-m-d'))); //十月 $October = date('Y-10',strtotime(date('Y-m-d'))); //十一月 $November = date('Y-11',strtotime(date('Y-m-d'))); //十二月 $December = date('Y-12',strtotime(date('Y-m-d'))); //咨询每月到院数据查询 $Model = M('order'); $where1['isct'] = 1; $where1['uid'] = $uid; $where1['today_m'] = $January; $where2['isct'] = 1; $where2['uid'] = $uid; $where2['today_m'] = $February; $where3['isct'] = 1; $where3['uid'] = $uid; $where3['today_m'] = $March; $where4['isct'] = 1; $where4['uid'] = $uid; $where4['today_m'] = $April; $where5['isct'] = 1; $where5['uid'] = $uid; $where5['today_m'] = $May; d43e $where6['isct'] = 1; $where6['uid'] = $uid; $where6['today_m'] = $June; $where7['isct'] = 1; $where7['uid'] = $uid; $where7['today_m'] = $July; $where8['isct'] = 1; $where8['uid'] = $uid; $where8['today_m'] = $August; $where9['isct'] = 1; $where9['uid'] = $uid; $where9['today_m'] = $September; $where10['isct'] = 1; $where10['uid'] = $uid; $where10['today_m'] = $October; $where11['isct'] = 1; $where11['uid'] = $uid; $where11['today_m'] = $November; $where12['isct'] = 1; $where12['uid'] = $uid; $where12['today_m'] = $December; $Januarys = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where1) ->count(); $Februarys = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where2) ->count(); $Marchs = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where3) ->count(); $Aprils = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where4) ->count(); $Mays = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where5) ->count(); $Junes = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where6) ->count(); $Julys = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where7) ->count(); $Augusts = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where8) ->count(); $Septembers = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where9) ->count(); $Octobers = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where10) ->count(); $Novembers = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where11) ->count(); $Decembers = $Model->join('t_user U ON t_order.uids = U.uid') ->field('t_order.today_m, t_order.isct, t_order.uids, U.fullname') ->where($where12) ->count(); return array( '0'=>$Januarys, //一月 '1'=>$Februarys, '2'=>$Marchs, '3'=>$Aprils, '4'=>$Mays, '5'=>$Junes, '6'=>$Julys, '7'=>$Augusts, '8'=>$Septembers, '9'=>$Octobers, '10'=>$Novembers, '11'=>$Decembers ); }
相关文章推荐
- PHP把一段时间处理成分时间段数组(带有名称及截止时间)
- TP3.2.3 查询今天 明天 上月 下月数据
- 转 php simple test
- laravel中发送邮件
- laravel框架中使用model层
- [置顶] php高效率写法
- laravel框架中使用model层
- 记一次PHP7+opcache+zmq出现SIGSEGV 问题的查找(一次不成功的bug查找)
- 安装laravel及其初步使用
- PHP面向对象总结
- 对laravel5概念的理解 -- 观察者模式(Event)
- php学习 left.php
- 转boolean时,值为假的情况
- 关于两个php.ini的说明
- PHP Ajax 跨域问题最佳解决方案
- php多进程pcntl学习(一)
- TPS和QPS的区别
- php中一个"异类"语法: $a && $b = $c;
- IIS6自带FTP安装及配置方法
- IIS 设置FTP用户名和密码