作者 赵彬吉
<?php
namespace App\Console\Commands\DayCount;
use App\Models\Inquiry\InquiryInfo;
use Illuminate\Console\Command;
/**
* @remark :
* @class :InquiryDelay.php
* @author :lyh
* @time :2023/7/14 10:16
*/
class InquiryDelay extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'inquiry_delay';
/**
* The console command description.
*
* @var string
*/
protected $description = '延时询盘转发(暂时弃用)';
/**
* @remark :延时询盘转发
* @name :handle
* @author :lyh
* @method :post
* @time :2023/7/14 10:17
*/
public function handle()
{
// $inquiryInfoModel = new InquiryInfo();
// $param = $inquiryInfoModel->formatQuery(['status'=>$inquiryInfoModel::STATUS_FOUR])->orderBy('send_time','asc')->first();
// if(!empty($param)){
// $time = date('Y-m-d H:i:s');
// if($time >= $param['send_time']){
// $data = [];
// //TODO::处理转发的url
// $arr_url = explode(',',$param['forward_url']);
// foreach ($arr_url as $v){
// $data['url'] = $v;
// $this->inquiryForward($data);
// }
// $inquiryInfoModel->edit(['status'=>$inquiryInfoModel::STATUS_THREE],['id'=>$param['id']]);
// }
// }
return true;
}
/**
* @remark :询盘转发
* @name :inquiryForward
* @author :lyh
* @method :post
* @time :2023/7/13 14:39
*/
public function inquiryForward($post_data){
$url = 'https://form.globalso.com/api/external-interface/add/fa043f9cbec6b38f';
$post_data_new = [];
$post_data_new['refer'] = $post_data['url'];
$post_data_new['name'] = $post_data['name'];
$post_data_new['email'] = $post_data['email'];
$post_data_new['phone'] = $post_data['phone'];
$post_data_new['ip'] = $post_data['ip'];
$post_data_new['message'] = $post_data['message'];
$post_data_new['submit_time'] = date('Y-m-d H:i:s',time()+20);
$token = md5($post_data_new['refer'].$post_data_new['name'].$post_data_new['ip'].date("Y-m-d",time()));
$post_data_new['token'] = $token;
$header = array(
'CLIENT-IP: '.$post_data['ip'],
'X-FORWARDED-FOR: '.$post_data['ip']
);
return http_post($url,$post_data_new,$header);
}
}
... ...
... ... @@ -293,7 +293,7 @@ class BTemplateLogic extends BaseLogic
}
$mainModel = new TemplateTypeMain();
$info = $mainModel->read(['type'=>$type,'is_list'=>$is_list]);
return $info['main_html'];
return $info['main_html'] ?? '';
}
/**
... ...
... ... @@ -2,7 +2,6 @@
namespace App\Jobs;
use App\Events\CopyImageFile;
use App\Models\File\File as FileModel;
use App\Models\File\Image as ImageModel;
use App\Services\AmazonS3Service;
... ...
... ... @@ -2,11 +2,7 @@
namespace App\Jobs;
use App\Events\CopyImageFile;
use App\Models\File\ErrorFile;
use App\Models\File\File as FileModel;
use App\Models\File\Image as ImageModel;
use App\Services\AmazonS3Service;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
... ...
<?php
/**
* @remark :
* @name :UpdatePageJob.php
* @author :lyh
* @method :post
* @time :2025/2/15 17:41
*/
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class UpdatePageJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public $tries = 3; // 可配置任务重试次数
protected $param;
/**
* Create a new job instance.
*
* @param CopyImageFile $event
* @return void
*/
public function __construct($data)
{
$this->param = $data;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
echo 'sj---:'.json_encode($this->param);
return true;
}
}
... ...