作者 赵彬吉
... ... @@ -76,6 +76,7 @@ class AiBlogAuthorTask extends Command
$this->saveAiBlogAuthor($result['data'] ?? [],$info['project_id']);
DB::disconnect('custom_mysql');
//修改任务状态
RouteMap::setRoute('top-blog',RouteMap::SOURCE_AI_BLOG_LIST,0,$info['project_id']);//写一条列表页路由
$aiBlogTaskModel->edit(['status'=>2],['id'=>$info['id']]);
echo '结束->任务id:' . $info['task_id'] . PHP_EOL . date('Y-m-d H:i:s');
}
... ... @@ -124,7 +125,6 @@ class AiBlogAuthorTask extends Command
];
$id = $aiBlogAuthorModel->addReturnId($param);
$route = RouteMap::setRoute($v['route'] ?? $v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id);
RouteMap::setRoute('top-blog',RouteMap::SOURCE_AI_BLOG_LIST,0,$project_id);//写一条列表页路由
$aiBlogAuthorModel->edit(['route'=>$route],['id'=>$id]);
}
}
... ...
... ... @@ -96,7 +96,10 @@ class PostInquiryForward extends Command
} else {
$res = $this->inquiry($detail, $val);
//转发表单
//转发详情
$detail->status = $res ? InquiryRelayDetail::STATUS_SEND : InquiryRelayDetail::STATUS_FAIL;
$detail->save();
//转发询盘
if ($res) {
$form = InquiryInfo::find($detail['form_id']);
$form->success = $form->success + 1;
... ...
... ... @@ -5,10 +5,13 @@
* Date: 2025/2/17
* Time: 11:24
*/
namespace App\Console\Commands\Inquiry;
use App\Helper\FormGlobalsoApi;
use App\Models\Channel\Channel;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Inquiry\InquiryProject;
use App\Models\Inquiry\InquiryProjectRoute;
use App\Models\Product\Category;
... ... @@ -58,9 +61,9 @@ class SyncInquiryProject extends Command
*/
public function handle()
{
echo '开始同步v5' . PHP_EOL;
$this->output('开始同步v5');
$this->syncGloV5();
echo '开始同步v6' . PHP_EOL;
$this->output('开始同步v6');
$this->syncGloV6();
return true;
}
... ... @@ -72,11 +75,12 @@ class SyncInquiryProject extends Command
public function syncGloV5()
{
$date = intval(date('Ymd'));
$last_week_time = date('Y-m-d H:i:s', strtotime('-1 week'));
$result = http_get('https://www.quanqiusou.cn/extend_api/webs/globalso_v5_tg.php');
$channel = Channel::pluck('contact_mobile', 'id')->toArray();
foreach ($result as $key=>$val)
{
echo '同步项目:' . $val['postid'] . ' - ' . $val['company'] . PHP_EOL;
$form_api = new FormGlobalsoApi();
foreach ($result as $key => $val) {
$this->output('同步项目:' . $val['postid'] . ' - ' . $val['company']);
// 记录渠道商, 如果渠道有问题, 记录日志, 跳过当前项目, 处理数据后, 第二天再重新同步
$channel_tmp = [];
foreach ($val['agent'] as $v) {
... ... @@ -94,10 +98,18 @@ class SyncInquiryProject extends Command
continue;
}
//判断项目7天之内是否有询盘
$recent_inquiry = 0;
$inquiry_list = $form_api->getInquiryList($val['main_url']);
$last_inquiry_time = $inquiry_list['data']['data'][0]['submit_time'] ?? '';
if ($last_inquiry_time > $last_week_time) {
$recent_inquiry = 1;
}
// 保存项目 以及 获取路由信息
$project = InquiryProject::saveProject($date, $val['v'], $val['postid'], $val['company'], implode(',', $channel_tmp), $val['main_url'], $val['is_split'], $val['test_url']);
$project = InquiryProject::saveProject($date, $val['v'], $val['postid'], $val['company'], implode(',', $channel_tmp), $val['main_url'], $recent_inquiry, $val['is_split'], $val['test_url']);
$route_domain = $val['is_split'] && $val['test_url'] ? $val['test_url'] : $val['main_url'];
try{
try {
$result = http_get($route_domain . 'k_u_api.php');
if (empty($result)) {
$this->log('syncGloV5Route 未获取到路由信息:' . $project->id . ', 路由获取地址:' . $route_domain . 'k_u_api.php');
... ... @@ -107,7 +119,7 @@ class SyncInquiryProject extends Command
$this->pushTask($project->id);
} catch (\Exception $e) {
$this->log('syncGloV5Route 未获取到路由信息:' . $project->id . ', 路由获取地址:' . $route_domain . 'k_u_api.php' . ', 错误信息:' . $e->getMessage());
echo 'syncGloV5Route 未获取到路由信息:' . $project->id . ', 路由获取地址:' . $route_domain . 'k_u_api.php' . ', 错误信息:' . $e->getMessage() . PHP_EOL;
$this->output('syncGloV5Route 未获取到路由信息:' . $project->id . ', 路由获取地址:' . $route_domain . 'k_u_api.php' . ', 错误信息:' . $e->getMessage());
continue;
}
}
... ... @@ -125,6 +137,7 @@ class SyncInquiryProject extends Command
public function syncGloV6()
{
$date = intval(date('Ymd'));
$last_week_time = date('Y-m-d H:i:s', strtotime('-1 week'));
// 获取优化中台项目
$project = Project::leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id')
->where('gl_project.type', Project::TYPE_TWO)
... ... @@ -133,15 +146,38 @@ class SyncInquiryProject extends Command
$query->orwhere('gl_project_online_check.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)
->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE);
})
->get(['gl_project.id', 'gl_project.title', 'gl_project.level', 'gl_project.channel']);
->get(['gl_project.id', 'gl_project.title', 'gl_project.level', 'gl_project.channel', 'gl_project.is_upgrade']);
// 获取所有项目域名
$domains = DomainInfo::whereIn('project_id', $project->pluck('id')->toArray())->pluck('domain', 'project_id')->toArray();
foreach ($project as $key=>$val) {
echo '同步项目:' . $val->id . ' - ' . $val->title . PHP_EOL;
$form_api = new FormGlobalsoApi();
foreach ($project as $key => $val) {
$this->output('同步项目:' . $val->id . ' - ' . $val->title);
// 过滤暂停优化项目, 映射类型2, model没有定义常量
if (in_array(2, $val->level))
continue;
$project = InquiryProject::saveProject($date,InquiryProject::VERSION_SIX, $val->id, $val->title, $val->channel['channel_id'], 'https://'.$domains[$val->id].'/');
$domain = $domains[$val->id] ?? '';
if(!$domain){
continue;
}
//判断项目7天之内是否有询盘
$recent_inquiry = 0;
$inquiry_list = $form_api->getInquiryList('https://' . $domain . '/', $val->is_upgrade);
$last_inquiry_time = $inquiry_list['data']['data'][0]['submit_time'] ?? '';
if ($last_inquiry_time > $last_week_time) {
$recent_inquiry = 1;
} else {
//自定义询盘也加入判断
ProjectServer::useProject($val->id);
$last_inquiry_time = InquiryFormData::orderBy('submit_at', 'desc')->value('submit_at');
if ($last_inquiry_time > $last_week_time) {
$recent_inquiry = 1;
}
DB::disconnect('custom_mysql');
}
$project = InquiryProject::saveProject($date, InquiryProject::VERSION_SIX, $val->id, $val->title, $val->channel['channel_id'], 'https://' . $domain . '/', $recent_inquiry);
$this->pushTask($project->id);
}
... ... @@ -189,4 +225,9 @@ class SyncInquiryProject extends Command
file_put_contents(storage_path('logs/zhl/output') . date('Y-m-d') . '.log', $message, FILE_APPEND);
return true;
}
public function output($message)
{
echo date('Y-m-d H:i:s') . ' | ' . $message . PHP_EOL;
}
}
... ...
... ... @@ -5,6 +5,7 @@
* Date: 2025/2/18
* Time: 17:10
*/
namespace App\Console\Commands\Inquiry;
use App\Models\Channel\Channel;
... ... @@ -70,7 +71,8 @@ class SyncInquiryProjectRoute extends Command
continue;
// 同步对应项目路由, 以及删除过期路由
if ($task->version == InquiryProject::VERSION_SIX){
$this->output('同步项目ID:' . $sync_id);
if ($task->version == InquiryProject::VERSION_SIX) {
$this->syncGloV6Route($task);
} else {
$this->syncGloV5Route($task);
... ... @@ -98,7 +100,7 @@ class SyncInquiryProjectRoute extends Command
return false;
}
foreach ($result as $key=>$val) {
foreach ($result as $key => $val) {
try {
$tmp = explode('|', $val);
$url_tmp = parse_url($tmp[0]);
... ... @@ -111,7 +113,7 @@ class SyncInquiryProjectRoute extends Command
InquiryProjectRoute::saveProjectRoute($task->id, $title, $route, $date);
} catch (\Exception $e) {
$this->log('syncGloV5Route 解析路径:' . $val . ', 错误信息:' . $e->getMessage());
echo 'syncGloV5Route 解析路径:' . $val . ', 错误信息:' . $e->getMessage() . PHP_EOL;
$this->output('syncGloV5Route 解析路径:' . $val . ', 错误信息:' . $e->getMessage());
}
}
... ... @@ -127,12 +129,11 @@ class SyncInquiryProjectRoute extends Command
*/
public function syncGloV6Route($task)
{
echo '同步项目ID:' . $task->id . PHP_EOL;
$date = intval(date('Ymd'));
ProjectServer::useProject($task->primary_id);
// 产品分类标题、路由, 产品标题、路由, 同步到路由表
$category = Category::where('status', Category::STATUS_ACTIVE)->get(['title', 'route']);
foreach ($category as $key=>$val) {
foreach ($category as $key => $val) {
InquiryProjectRoute::saveProjectRoute($task->id, $val->title, $val->route, $date);
}
... ... @@ -143,7 +144,7 @@ class SyncInquiryProjectRoute extends Command
if ($product->isEmpty())
break;
foreach ($product as $key=>$val) {
foreach ($product as $key => $val) {
$id = $val->id;
InquiryProjectRoute::saveProjectRoute($task->id, $val->title, $val->route, $date);
}
... ... @@ -181,4 +182,9 @@ class SyncInquiryProjectRoute extends Command
file_put_contents(storage_path('logs/zhl/output') . date('Y-m-d') . '.log', $message, FILE_APPEND);
return true;
}
public function output($message)
{
echo date('Y-m-d H:i:s') . ' | ' . $message . PHP_EOL;
}
}
... ...
... ... @@ -40,12 +40,12 @@ class DownloadProject extends Command
protected $description = '导出项目数据';
public function handle(){
ProjectServer::useProject(5);
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
$v6WeekModel = new V6WeeklyReport();
$data = $v6WeekModel->read(['id'=>28058]);
$data = $this->workChatMessage($data,5);
DB::disconnect('custom_mysql');
$lists = $v6WeekModel->list([],'id',['*'],'desc',100);
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
foreach ($lists as $data){
$this->workChatMessage($data,$data['project_id']);
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
return true;
}
... ... @@ -226,7 +226,7 @@ class DownloadProject extends Command
$country .= $k.'、';
};
$country = trim($country,'、');
$content1 = '询盘主要来源于'.$country.'等国家地区';
$content1 .= '询盘主要来源于'.$country.'等国家地区';
}
$content1 .= '如有高质量客户,请您密切关注与跟进;';
}
... ... @@ -312,12 +312,12 @@ class DownloadProject extends Command
$tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
$param = [
'project_id'=>$project_id,
'friend_id'=>1,
'friend_id'=>17667,
'type'=>MessagePush::TYPE_WEEK,
'content'=>"【全球搜V6.0周报】"."\n".$content,
'content'=>"【全球搜V6.0周报】--项目id:$project_id"."\n".$content,
'ref_ids'=>'',
'send_time'=>$tomorrowNineAM,
'status'=>3,
'status'=>0,
];
//写入一条推送消息 自动消费
$messagePushModel = new MessagePush();
... ...
... ... @@ -12,7 +12,10 @@ namespace App\Console\Commands\LyhTest;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\CustomModule\CustomModuleExtentContent;
use App\Models\News\News;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BTemplate;
use App\Models\Template\Template;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -33,7 +36,7 @@ class LyhImportTest extends Command
*/
protected $description = '导入数据';
public $data = 'GBP201,Rectifier/Bridge Rectifier,GBP,-,100,2,1.10 ,1,60,5,250,-55~+150,-,Active,';
public $data = '';
/**
* @remark :统一更新路由
... ... @@ -43,9 +46,10 @@ class LyhImportTest extends Command
* @time :2023/11/20 15:13
*/
public function handle(){
ProjectServer::useProject(2837);
ProjectServer::useProject(2385);
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
$this->importCustomModule($this->data);
// $this->importCustomModule($this->data);
$this->newsImportCustom();
DB::disconnect('custom_mysql');
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
... ... @@ -106,4 +110,42 @@ class LyhImportTest extends Command
$customExtendContentTModel->insert($saveData);
}
}
/**
* @remark :新闻导入到扩展模块
* @name :newsImportCustom
* @author :lyh
* @method :post
* @time :2025/2/28 11:04
*/
public function newsImportCustom($project_id = 2385){
$newsModel = new News();
$lists = $newsModel->list(['category_id'=>',3,']);
foreach ($lists as $k => $v){
$param = [
'name'=>$v['name'],
'content'=>$v['text'],
'remark'=>$v['remark'],
'route'=>$v['url'],
'image'=>$v['image'],
'seo_title'=>$v['seo_title'],
'seo_keywords'=>$v['seo_keywords'],
'seo_description'=>$v['seo_keywords'],
'project_id'=>$project_id,
'operator_id'=>$v['operator_id'],
'release_at'=>$v['release_at'],
'module_id'=>3,
'category_id'=>',2,',
];
//删除当前新闻的路由
RouteMap::delRoute(RouteMap::SOURCE_NEWS,$v['id'],$project_id);
//删除当前数据
$newsModel->del(['id'=>$v['id']]);
$customContentModel = new CustomModuleContent();
$id = $customContentModel->addReturnId($param);
$route = RouteMap::setRoute($param['route'],RouteMap::SOURCE_MODULE,$id,$project_id);
$customContentModel->edit(['route'=>$route],['id'=>$id]);
}
return true;
}
}
... ...
... ... @@ -52,7 +52,7 @@ class WeekProject extends Command
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['delete_status'=>0,'is_weekly_report'=>1,'type'=>['in',[1,2,3,4,6]]],'id',['id','title']);
$list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]],'id',['id','title']);
foreach ($list as $k => $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
... ... @@ -83,8 +83,9 @@ class WeekProject extends Command
$data['start_date'] = $startOfLastWeekFormatted = date('Y-m-d', $startOfLastWeek);
$data['end_date'] = $endOfLastWeekFormatted = date('Y-m-d', $endOfLastWeek);
$countModel = new Count();
$startOfThisWeek = date('Y-m-d', strtotime("monday this week"));
$startOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']);
$endOfLastWeekFormattedInfo = $countModel->read(['date'=>$endOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']);
$endOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfThisWeek,'project_id'=>$value['id']],['inquiry_num','country']);
$data['inquiry_total'] = $endOfLastWeekFormattedInfo['inquiry_num'] ?? 0;//询盘数量
$data['inquiry_country'] = $endOfLastWeekFormattedInfo['country'] ?? json_encode([]);
$data['week_inquiry_total'] = ($endOfLastWeekFormattedInfo['inquiry_num'] ?? 0) - ($startOfLastWeekFormattedInfo['inquiry_num'] ?? 0);
... ...
... ... @@ -641,6 +641,7 @@ if (!function_exists('getImageUrl')) {
if($location == 0){
$cos = config('filesystems.disks.cos');
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
// $cosCdn = 'https://file.globalso.com';//TODO::暂时使用
$url = $cosCdn.$path;
}else{
$s3 = config('filesystems.disks.s3');
... ...
... ... @@ -7,6 +7,7 @@ use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Ai\AiCommandLogic;
use App\Http\Requests\Aside\Ai\AiCommandRequest;
use App\Models\Ai\AiCommand as AiCommandModel;
use App\Models\Project\Project;
/**
* @remark :ai指令
... ... @@ -28,8 +29,17 @@ class AiCommandController extends BaseController
$this->map['name|key|ai'] = ['like','%'.$this->map['scene'].'%'];
unset($this->map['scene']);
}
$lists = $aiCommandModel->lists($this->map,$this->page,$this->row,$this->order);
$projectModel = new Project();
if(!empty($lists) && !empty($lists['list'])){
foreach ($lists['list'] as $k => $v){
$v['project_name'] = '';
if($v['project_id'] != 0){
$v['project_name'] = $projectModel->getProjectName($v['project_id']);
}
$lists['list'][$k] = $v;
}
}
$this->response('success',Code::SUCCESS,$lists);
}
... ...
... ... @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Aside\Optimize;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Logic\Aside\Optimize\InquiryForwardLogic;
use App\Models\Inquiry\AreaTimezone;
class InquiryForwardController extends BaseController
{
... ... @@ -74,8 +75,6 @@ class InquiryForwardController extends BaseController
'ip' => 'required',//ip
'forward_url' => 'required',//转发网址
'message' => 'required',//发送内容
'inquiry_diff' => 'required',//发送时区
'inquiry_date' => 'required',//发送时间
], [
'id.required' => 'ID不能为空',
'name.required' => '名称不能为空',
... ... @@ -84,8 +83,6 @@ class InquiryForwardController extends BaseController
'ip.required' => 'ip不能为空',
'forward_url.required' => '转发网址不能为空',
'message.required' => '内容不能为空',
'inquiry_diff.required' => '发送时区不能为空',
'inquiry_date.required' => '发送时间不能为空',
]);
}
... ...
... ... @@ -7,6 +7,7 @@ use App\Helper\Gpt;
use App\Helper\Translate;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Ai\AiCommand;
use App\Models\Inquiry\AreaTimezone;
use App\Models\Inquiry\InquiryInfo;
use App\Models\Inquiry\InquiryProject;
use App\Models\Inquiry\InquiryProjectRoute;
... ... @@ -40,7 +41,15 @@ class InquiryForwardLogic extends BaseLogic
*/
public function getType()
{
return $this->success($this->model->typeMap());
$type = $this->model->typeMap();
$list = [];
foreach ($type as $k => $v) {
$list[] = [
'id' => $k,
'name' => $v
];
}
return $this->success($list);
}
/**
... ... @@ -97,14 +106,50 @@ class InquiryForwardLogic extends BaseLogic
$is_v6 = $project_version->version == 6 ? 1 : 0;
//计算发送时间
if ($this->param['inquiry_diff'] > 0) {
$start_at = date('Y-m-d H:i:s', strtotime($this->param['inquiry_date'] . ' -' . $this->param['inquiry_diff'] . ' hours'));
} elseif ($this->param['inquiry_diff'] < 0) {
$start_at = date('Y-m-d H:i:s', strtotime($this->param['inquiry_date'] . ' +' . abs($this->param['inquiry_diff']) . ' hours'));
} else {
//获取发送时间
if (isset($this->param['inquiry_date']) && $this->param['inquiry_date']) {
//填写了时间,直接使用
$start_at = $this->param['inquiry_date'];
} else {
//未填写时间
//1.根据时差获取当地随机10-18点时间
$timezoneModel = new AreaTimezone();
$country_area = $timezoneModel->read(['name' => $info['country']], ['diff']);
$diff = $country_area ? $country_area['diff'] : 0;
if ($diff > 0) {
$area_time = date('Y-m-d H:i:s', strtotime($now . ' +' . $diff . ' hours'));
} elseif ($diff < 0) {
$area_time = date('Y-m-d H:i:s', strtotime($now . ' -' . abs($diff) . ' hours'));
} else {
$area_time = $now;
}
$area_timestamp = strtotime($area_time);
$area_hour = date('H', $area_timestamp);
if ($area_hour < 18) {
//当地时间为18点前
$area_day = date('Y-m-d', $area_timestamp);
$area_start_time = $area_hour < 10 ? '10:00:00' : date('H:i:s', $area_timestamp);
} else {
//当地时间为18点后,顺延一天
$area_day = date('Y-m-d', strtotime($area_time . ' +1 day'));
$area_start_time = '10:00:00';
}
$start_time = strtotime($area_day . ' ' . $area_start_time);
$end_time = strtotime($area_day . ' 18:00:00');
$random_timestamp = mt_rand($start_time, $end_time);
$area_date = date('Y-m-d H:i:s', $random_timestamp);
//2.再根据时差将随机生成的当地时间换算成国内时间
if ($diff > 0) {
$start_at = date('Y-m-d H:i:s', strtotime($area_date . ' -' . $diff . ' hours'));
} elseif ($diff < 0) {
$start_at = date('Y-m-d H:i:s', strtotime($area_date . ' +' . abs($diff) . ' hours'));
} else {
$start_at = $area_date;
}
}
//换算后的国内时间小于当前时间,使用当前时间
if ($start_at < $now) {
$start_at = $now;
}
... ...
... ... @@ -104,11 +104,6 @@ class AiBlogLogic extends BaseLogic
if($result['status'] == 200){
$aiBlogTaskModel = new AiBlogTask();
$aiBlogTaskModel->addReturnId(['project_id'=>$this->user['project_id'],'type'=>2,'task_id'=>$result['data']['task_id'],'status'=>1]);
//增加一条更新列表页的记录
$aiThreeInfo = $aiBlogTaskModel->read(['project_id'=>$this->user['project_id'],'type'=>3,'status'=>1]);
if($aiThreeInfo === false){
$aiBlogTaskModel->addReturnId(['project_id'=>$this->user['project_id'],'type'=>3,'status'=>1]);
}
$aiBlogModel = new AiBlog();
$aiBlogModel->addReturnId(['keyword'=>$this->param['keyword'], 'status'=>1, 'task_id'=>$result['data']['task_id'],'project_id'=>$this->user['project_id'],
]);
... ...
... ... @@ -35,7 +35,7 @@ class SyncImageFileJob implements ShouldQueue
public function handle()
{
$file_path = $this->getUrl($this->param['path'].'/'.$this->param['name'], 0,$this->param['location']);
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$this->param['path'].'" https://v6-file.globalso.com/upload.php';
echo date('Y-m-d H:i:s') . ' | ' . $cmd . PHP_EOL;
$code = shell_exec($cmd);
if(200 != (int)$code){
... ...
... ... @@ -33,15 +33,17 @@ class InquiryProject extends Base
* @param $project
* @param $channel
* @param $domain
* @param $recent_inquiry
* @param int $is_split
* @param string $test_domain
* @return InquiryProject
*/
public static function saveProject($date, $version, $primary_id, $project, $channel, $domain, $is_split = 0, $test_domain = '')
public static function saveProject($date, $version, $primary_id, $project, $channel, $domain,$recent_inquiry, $is_split = 0, $test_domain = '')
{
$log = self::where(compact('version', 'primary_id'))->first();
if ($log) {
$log->date = $date;
$log->recent_inquiry = $recent_inquiry;
$log->save();
return $log;
}
... ... @@ -54,6 +56,7 @@ class InquiryProject extends Base
$self->is_split = $is_split;
$self->test_domain = $test_domain;
$self->date = $date;
$self->recent_inquiry = $recent_inquiry;
$self->save();
return $self;
}
... ...
... ... @@ -23,12 +23,12 @@ class InquiryRelayDetail extends Model
protected $table = 'gl_inquiry_relay_detail';
/**
* 任务状态, 0:待处理,1:处理中,2:处理成功,3:抛弃数据,9:处理失败
* 任务状态, 0:待处理,1:处理中,2:待转发,3:转发成功,9:转发失败
*/
const STATUS_INIT = 0;
const STATUS_PEND = 1;
const STATUS_SUCCESS = 2;
const STATUS_FORGO = 3;
const STATUS_SEND = 3;
const STATUS_FAIL = 9;
/**
... ... @@ -40,9 +40,9 @@ class InquiryRelayDetail extends Model
return [
self::STATUS_INIT => '待处理',
self::STATUS_PEND => '处理中',
self::STATUS_SUCCESS => '处理成功',
self::STATUS_FORGO => '抛弃数据',
self::STATUS_FAIL => '处理失败',
self::STATUS_SUCCESS => '待转发',
self::STATUS_SEND => '转发成功',
self::STATUS_FAIL => '转发失败',
];
}
... ...
... ... @@ -23,7 +23,7 @@ class InquiryRelayDetailLog extends Model
protected $table = 'gl_inquiry_relay_detail_log';
/**
* 任务状态, 0:初始化,1:待处理,2:处理成功,9:处理失败
* 任务状态, 0:未发送,1:发送中,2:发送成功,9:发送失败
*/
const STATUS_INIT = 0;
const STATUS_PEND = 1;
... ... @@ -43,10 +43,10 @@ class InquiryRelayDetailLog extends Model
public static function statusMap()
{
return [
self::STATUS_INIT => '初始化',
self::STATUS_PEND => '待处理',
self::STATUS_SUCCESS => '处理成功',
self::STATUS_FAIL => '处理失败',
self::STATUS_INIT => '未发送',
self::STATUS_PEND => '发送中',
self::STATUS_SUCCESS => '发送成功',
self::STATUS_FAIL => '发送失败',
];
}
... ...