|
...
|
...
|
@@ -8,6 +8,7 @@ use App\Models\Inquiry\ReInquiryForm; |
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class postInquiry
|
|
...
|
...
|
@@ -50,6 +51,18 @@ class postInquiry extends Command |
|
|
|
}
|
|
|
|
// 询盘数据入库
|
|
|
|
foreach ($list as $key => $val) {
|
|
|
|
//加个锁 避免重复执行
|
|
|
|
$lockKey = 're_inquiry_detail_log_lock_' . $val->id;
|
|
|
|
if(!Redis::setnx($lockKey, 1)){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
Redis::expire($lockKey, 60);
|
|
|
|
|
|
|
|
$log = ReInquiryDetailLog::find($val->id);
|
|
|
|
if($log->status != ReInquiryDetailLog::STATUS_INIT){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
$this->output('开始执行' . $val->id);
|
|
|
|
try {
|
|
|
|
$detail = ReInquiryDetail::find($val['detail_id']);
|
...
|
...
|
|