作者 lyh

gx脚本

... ... @@ -41,7 +41,7 @@ class DownloadProject extends Command
public function handle(){
$v6WeekModel = new V6WeeklyReport();
$lists = $v6WeekModel->list([],'id',['*'],'desc',100);
$lists = $v6WeekModel->list(['id'=>1431],'id',['*'],'desc',100);
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
foreach ($lists as $data){
$this->workChatMessage($data,$data['project_id']);
... ... @@ -218,7 +218,7 @@ class DownloadProject extends Command
$content1 .= '本周新收 '.$data['week_inquiry_total'].' 封询盘。';
}
if(!empty($data['inquiry_country'])){
$data['inquiry_country'] = json_decode($data['inquiry_country'],true);
$data['inquiry_country'] = json_decode($data['inquiry_country'],JSON_UNESCAPED_UNICODE);
arsort($data['inquiry_country']);
$data['inquiry_country'] = array_slice($data['inquiry_country'], 0, 4, true);
$country = '';
... ... @@ -306,16 +306,19 @@ class DownloadProject extends Command
}
$arr[] = $content4;
foreach ($arr as $key => $val){
$content .= ($key+1).','.$val."\n";
$content .= ($key+1).','.$val.PHP_EOL;
}
$timestamp = strtotime('tomorrow 9:00 AM');
$tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
$content = preg_replace('/[\x00-\x1F\x7F]/u', '', $content);
if(empty($content)){
return true;
}
$param = [
'project_id'=>$project_id,
'friend_id'=>17667,
'type'=>MessagePush::TYPE_WEEK,
'content'=>"【全球搜V6.0周报】--项目id:$project_id"."\n".$content,
'content'=>"【全球搜V6.0周报】--项目id:$project_id".PHP_EOL.$content,
'ref_ids'=>'',
'send_time'=>$tomorrowNineAM,
'status'=>0,
... ...
... ... @@ -259,6 +259,9 @@ class WeekProject extends Command
$timestamp = strtotime('tomorrow 9:00 AM');
$tomorrowNineAM = date('Y-m-d H:i:s', $timestamp);
$content = preg_replace('/[\x00-\x1F\x7F]/u', '', $content);
if(empty($content)){
return true;
}
$param = [
'project_id'=>$project_id,
'friend_id'=>$friend_id,
... ...