作者 lyh

gx数据

@@ -31,6 +31,13 @@ class RemainDay extends Command @@ -31,6 +31,13 @@ class RemainDay extends Command
31 ];//需要单独处理的项目 31 ];//需要单独处理的项目
32 32
33 /** 33 /**
  34 + * @var int[]
  35 + * 按照达标天数收费的项目
  36 + */
  37 + protected $bm_projectId = [];
  38 +
  39 +
  40 + /**
34 * @var 暂停的项目 41 * @var 暂停的项目
35 */ 42 */
36 protected $ceaseProjectId = [ 43 protected $ceaseProjectId = [
@@ -123,11 +130,18 @@ class RemainDay extends Command @@ -123,11 +130,18 @@ class RemainDay extends Command
123 //白帽版本的系统 130 //白帽版本的系统
124 if($deploy_build['seo_plan'] == 1){ 131 if($deploy_build['seo_plan'] == 1){
125 if($deploy_build['seo_service_duration'] != 0){ 132 if($deploy_build['seo_service_duration'] != 0){
126 - if($item['bm_finish_remain_day']){  
127 - $compliance_day = (int)$item['bm_finish_remain_day'];  
128 - $seo_remain_day = $deploy_build['seo_service_duration'] - $compliance_day; 133 + if(in_array($item['id'],$this->bm_projectId)){
  134 + if($item['bm_finish_remain_day']){
  135 + $compliance_day = (int)$item['bm_finish_remain_day'];
  136 + $seo_remain_day = $deploy_build['seo_service_duration'] - $compliance_day;
  137 + }else{
  138 + $seo_remain_day = $deploy_build['seo_service_duration'];
  139 + }
129 }else{ 140 }else{
130 - $seo_remain_day = $deploy_build['seo_service_duration']; 141 + //按自然日统计
  142 + $diff = time() - strtotime($item['uptime']);
  143 + $compliance_day = floor($diff / (60 * 60 * 24));
  144 + $seo_remain_day = $deploy_build['service_duration'] - $compliance_day;
131 } 145 }
132 if($deploy_build['plan'] == 0 && $seo_remain_day < 0 && $deploy_build['seo_service_duration'] != 0){//只有白帽版本的项目且剩余服务时常为0,放入未续费中 146 if($deploy_build['plan'] == 0 && $seo_remain_day < 0 && $deploy_build['seo_service_duration'] != 0){//只有白帽版本的项目且剩余服务时常为0,放入未续费中
133 // $this->project->edit(['seo_remain_day'=>$seo_remain_day,'finish_remain_day'=>$compliance_day ?? 0,'extend_type'=>Project::TYPE_FIVE],['id'=>$item['id']]); 147 // $this->project->edit(['seo_remain_day'=>$seo_remain_day,'finish_remain_day'=>$compliance_day ?? 0,'extend_type'=>Project::TYPE_FIVE],['id'=>$item['id']]);