作者 lyh

gx

@@ -49,7 +49,12 @@ class Count extends Command @@ -49,7 +49,12 @@ class Count extends Command
49 //服务达标天数 49 //服务达标天数
50 $arr['compliance_day'] = $this->compliance_day($yesterday); 50 $arr['compliance_day'] = $this->compliance_day($yesterday);
51 //剩余服务时常 51 //剩余服务时常
52 - $arr['service_day'] = $v['service_duration'] - Common::getDaysToTargetDate($v['created_at']); 52 + if($v['service_duration'] != 0){
  53 + $arr['service_day'] = ($v['service_duration'] - Common::getDaysToTargetDate($v['created_at']));
  54 + $arr['service_day'] = $arr['service_day'] > 0 ? $arr['service_day'] : 0;
  55 + }else{
  56 + $arr['service_day'] = 0;
  57 + }
53 //项目id 58 //项目id
54 $arr['project_id'] = $v['project_id']; 59 $arr['project_id'] = $v['project_id'];
55 $arr['created_at'] = date('Y-m-d H:i:s'); 60 $arr['created_at'] = date('Y-m-d H:i:s');
@@ -163,7 +163,7 @@ class MonthCountLogic extends BaseLogic @@ -163,7 +163,7 @@ class MonthCountLogic extends BaseLogic
163 $count = new Count(); 163 $count = new Count();
164 $startTime = date("Y-m-d", strtotime("-9 months", mktime(0, 0, 0))); 164 $startTime = date("Y-m-d", strtotime("-9 months", mktime(0, 0, 0)));
165 $ensTime = date('Y-m-d',time()); 165 $ensTime = date('Y-m-d',time());
166 - $lists = $count->list(['date'=>['between',[$startTime,$ensTime]]]); 166 + $lists = $count->list(['date'=>['between',[$startTime,$ensTime]],'project_id'=>$this->user['project_id']]);
167 return $this->success($lists); 167 return $this->success($lists);
168 } 168 }
169 } 169 }