作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2346
... ... @@ -98,14 +98,14 @@ class GeoQuestionRes extends Command
goto GET_RESULT;
}
} catch (\Exception $e) {
$this->output('task id:' . $task_id . ', question: ' . $question . ', platform: ' . $question . ', error: ' . $e->getMessage());
$this->output('task id:' . $task_id . ', question: ' . $question . ', platform: ' . $platform . ', error: ' . $e->getMessage());
goto GET_RESULT;
}
// 命中文案
$hit_data[] = $result['text'];
if(!empty($result['annotations'])){
$url = array_column(array_column($result['annotations'], 'url_citation'), 'url');
$title = array_column(array_column($result['annotations'], 'url_citation'), 'title');;
$title = array_column(array_column($result['annotations'], 'url_citation'), 'title');
$hit_data = array_merge($url, $title, $hit_data);
}
// 命中关键词和路由
... ...
... ... @@ -9,6 +9,7 @@
namespace App\Console\Commands\Sync;
use App\Models\Manage\Mobile;
use App\Models\User\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -40,30 +41,40 @@ class SyncMobile extends Command
$url = 'https://www.quanqiusou.cn/extend_api/saas/get_phone.php';
// $data = curlGet($url);//TODO::获取号码库
$client = new \GuzzleHttp\Client();
try {
$data = $client->request('GET', $url, [
'proxy' => env('CURL_PROXY'), // 代理服务器地址和端口号
])->getBody()->getContents();
}catch (\Exception $e){
echo date('Y-m-d H:i:s').':未拉起到数据'.PHP_EOL;
}
if(!empty($data)){
$mobileModel = new Mobile();
$mobileModel->truncate();
$data = json_decode($data, true);
DB::table('gl_mobile')->delete();
$create_time = date('Y-m-d H:i:s');
foreach ($data as $v){
$userModel = new User();
foreach ($data as $mobile){
$param = [
'mobile'=>$v,
'created_at'=>$create_time
'mobile'=>$mobile,
'created_at'=>date('Y-m-d H:i:s')
];
$mobile->insert($param);
//查看当前用户是否存在
$info = $userModel->read(['mobile'=>$mobile,'project_id'=>1]);
if($info === false){
$data = [
'mobile'=>$mobile,
'password'=>base64_encode(md5('123456')),
'project_id'=>1,
'name'=>$mobile,
'type'=>$userModel::TYPE_ONE
];
DB::table('gl_mobile')->insert($param);
$userModel->add($data);
}
}
if(!empty($data)){
$userModel = new User();
try {
$data[] = '13083988828';
$data[] = '6591559603';
$userModel->edit(['status'=>1],['project_id'=>1,'mobile'=>['not in',$data]]);
$userModel->edit(['status'=>0],['project_id'=>1,'mobile'=>['in',$data]]);
}catch (\Exception $e){
echo date('Y-m-d H:i:s') . 'error' . PHP_EOL;
}
}
}
}
... ...
... ... @@ -665,7 +665,7 @@ if (!function_exists('getImageUrl')) {
* @method :post
* @time :2023/7/20 16:46
*/
function getImageUrl($path,$storage_type = 0,$location = 0){
function getImageUrl($path,$storage_type = 0,$location = 0,$image_cdn = 1){
if(is_array($path)){
$url =[];
foreach ($path as $v){
... ... @@ -683,8 +683,11 @@ if (!function_exists('getImageUrl')) {
}
if($location == 0){
$cos = config('filesystems.disks.cos');
if($image_cdn == 0){//v6链接
$cosCdn = $cos['cdn2'];
}else{
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
// $cosCdn = 'https://file.globalso.com';//TODO::暂时使用
}
$url = $cosCdn.$path;
}else{
$s3 = config('filesystems.disks.s3');
... ...