1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\api\controller\screen;
- use app\hander\HelpHander;
- use think\Db;
- class Complain extends Index
- {
- public function monthData(){
- $month = [];
- $y = [];
- for ($i=11;$i>=0;$i--){
- $month[11-$i] = date('Ym',strtotime('-'.$i.'month'));
- $y[] = date('m',strtotime('-'.$i.'month'));
- }
- $list = [];
- foreach ($month as $k=>$v){
- $list[] = Db::name('complain')->where('org_id',$this->orgId)->where('del',0)->where('create_yyyymm',$v)->count();
- }
- foreach ($y as $k=>$v){
- if($v < 10){
- $n = substr($v,1,1);
- }else{
- $n = $v;
- }
- $y[$k] = $n;
- }
- HelpHander::success(['month'=>$y,'list'=>$list]);
- }
- public function complainList(){
- $list = Db::name('complain')->where('org_id',$this->orgId)->where('del',0)->where('create_yyyymmdd',date('Ymd'))->order('id desc')->select();
- $data = [];
- foreach ($list as $k=>$v){
- $data[$k][] = date('m-d H:i',strtotime($v['create_time']));
- $data[$k][] = $v['content'];
- $data[$k][] = model('Complain')->formatStatus($v['status'],$v['order_id'],$v['id']);
- $data[$k][] = date('m-d H:i',strtotime($v['update_time']));
- }
- HelpHander::success($data);
- }
- }
|