作者 lyh

gx

... ... @@ -82,8 +82,10 @@ class Count extends Command
$arr['updated_at'] = date('Y-m-d H:i:s');
//询盘统计
$arr = $this->inquiry($arr,$v['test_domain'], $v['id']);
echo date('Y-m-d H:i:s') . json_encode($arr) . '->' . PHP_EOL;
$data[] = $arr;
if($arr !== false){
echo date('Y-m-d H:i:s') . json_encode($arr) . '->' . PHP_EOL;
$data[] = $arr;
}
}
//判断数据是否存在
DB::table('gl_count')->insert($data);
... ... @@ -128,6 +130,9 @@ class Count extends Command
*/
public function inquiry($arr,$domain,$project_id){
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
if($inquiry_list == false){
return false;
}
if($inquiry_list['status'] == self::STATUS_ERROR){
$arr['inquiry_num'] = 0;
$countryArr = [];
... ...
... ... @@ -42,16 +42,16 @@ class ImportChannel extends Command
'channel'=>['like','%"user_id": "0"%'],
];
$lists = $projectModel->list($map);
// var_dump($lists);
// die();
foreach ($lists as $k => $v){
$order_id = $v['notice_order_id'];
$api = new OaGlobalsoApi();
$data = $api->order_info($order_id);
$data = $data['data'];
$channel = Channel::getProjectChannel($data['company_id'], $data['username_sales']);
$projectModel->edit(['channel'=>$channel],['id'=>$v['id']]);
if(!empty($lists)){
foreach ($lists as $k => $v){
$order_id = $v['notice_order_id'];
$api = new OaGlobalsoApi();
$data = $api->order_info($order_id);
$data = $data['data'];
$channel = Channel::getProjectChannel($data['company_id'], $data['username_sales']);
$projectModel->edit(['channel'=>$channel],['id'=>$v['id']]);
}
}
return 1;
return true;
}
}
... ...
... ... @@ -30,7 +30,7 @@ class ImportManager extends Command
*
* @var string
*/
protected $description = '导入数据';
protected $description = '导入数据(同步5.0人事信息)';
/**
* @remark :导入5.0管理员数据
* @name :handle
... ...
... ... @@ -57,13 +57,10 @@ class LastInquiry extends Command
//其他询盘的最新时间
ProjectServer::useProject($item['id']);
$other_last_time = InquiryFormData::orderBy('id', 'desc')->value('submit_at');
$last_inquiry_time = $last_time > $other_last_time ? $last_time : $other_last_time;
if(!$last_inquiry_time){
continue;
}
$item->last_inquiry_time = $last_inquiry_time;
$item->save();
}
... ...
... ... @@ -74,7 +74,7 @@ class InquiryMonthlyCount extends Command
try {
DB::table('gl_month_count')->insert($arr);
}catch (\Exception $e){
Log::channel('month_count')->error('day_count:失败 ' . $e->getMessage());
Log::channel('month_count')->error('month_count:失败 ' . $e->getMessage());
}
}
return true;
... ...