作者 赵彬吉

update

@@ -44,20 +44,22 @@ class FBInquiryRemainDay extends Command @@ -44,20 +44,22 @@ class FBInquiryRemainDay extends Command
44 foreach ($list as $item){ 44 foreach ($list as $item){
45 $this->output('start:' . $item['id']); 45 $this->output('start:' . $item['id']);
46 46
47 - $item->tasks = $item->tasks; //调用访问器 47 + $tasks = $item->tasks; //调用访问器
48 $is_v6 = 0; 48 $is_v6 = 0;
49 - foreach ($item->tasks as $task){ 49 + foreach ($tasks as $task){
50 if($task['is_v6']){ 50 if($task['is_v6']){
51 $is_v6 = 1; 51 $is_v6 = 1;
52 } 52 }
53 } 53 }
54 if($is_v6){ 54 if($is_v6){
55 - $item['project_id'] = DomainInfo::where('domain', $item['domain'])->value('project_id') ?: 0; 55 + $project_id = DomainInfo::where('domain', $item['domain'])->value('project_id') ?: 0;
56 }else{ 56 }else{
57 - $item['project_id'] = 0; 57 + $project_id = 0;
58 } 58 }
59 //获取剩余天数 59 //获取剩余天数
60 - ReInquiryCount::getRemainingDays($item['domain'], $item['type'], $item['project_id']); 60 + $remaining_days = ReInquiryCount::getRemainingDays($item['domain'], $item['type'], $project_id);
  61 + $item->remaining_days = $remaining_days;
  62 + $item->save();
61 } 63 }
62 64
63 } 65 }
@@ -400,8 +400,6 @@ class AdsController extends BaseController @@ -400,8 +400,6 @@ class AdsController extends BaseController
400 }else{ 400 }else{
401 $item['project_id'] = 0; 401 $item['project_id'] = 0;
402 } 402 }
403 - //获取剩余天数  
404 - $item['remaining_days'] = ReInquiryCount::getRemainingDays($item['domain'], $item['type'], $item['project_id']);  
405 } 403 }
406 404
407 return $this->response('success', Code::SUCCESS, $result); 405 return $this->response('success', Code::SUCCESS, $result);