作者 lyh

gx

... ... @@ -16,6 +16,7 @@ use App\Helper\Common;
use App\Helper\Translate;
use App\Helper\Wechat;
use App\Http\Logic\Bside\User\UserLoginLogic;
use App\Models\Channel\Channel;
use App\Models\Domain\DomainInfo;
use App\Models\Project\Project;
use App\Models\Service\Service;
... ... @@ -24,7 +25,9 @@ use App\Models\User\DeptUser;
use App\Models\User\ProjectRole;
use App\Models\User\User;
use App\Utils\EncryptUtils;
use App\Utils\LogUtils;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Mrgoon\AliSms\AliSms;
class LoginController extends BaseController
... ... @@ -299,4 +302,67 @@ class LoginController extends BaseController
}
return $data;
}
public function ceshi(){
$this->toAicc();
$this->toHagro();
$this->response('success');
}
/**
* 同步到AICC
* @param $data
* @author zbj
* @date 2023/9/1
*/
public function toAicc(){
$url = 'https://biz.ai.cc/api/sync_company_for_order';
$param = [
'company_name' => '西安奥谷生物科技有限公司',
'company_address' => '',
'company_tel' => '18091843361',
'company_email' => '',
'remark' => '',
'level_id' => 6,
'level_day' => 1095,
'from_order_id' => '64ffd2db6dde4',
];
//sign
ksort($param);
$tem = [];
foreach ($param as $key => $val) {
$tem[] = $key . '=' . urlencode($val);
}
$string = implode('&', $tem);
$key = md5('quanqiusou.com');
$param['sign'] = md5($string . $key);
$res = Http::withoutVerifying()->post($url, $param)->json();
if(empty($res['status']) || $res['status'] != 200){
LogUtils::error('ProjectToAicc error', $res);
}
}
/**
* 同步到Hagro
* @param $data
* @author zbj
* @date 2023/9/1
*/
public function toHagro(){
$url = 'https://admin.hagro.cn/globalso/create_project';
$param = [
'company' => '西安奥谷生物科技有限公司',
'phone' => '18091843361',
'planday' => 1095 ?: 1,
'from_order_id' => '64ffd2db6dde4',
'agent_phone' => Channel::where('source_id',217)->value('contact_mobile') ?: '',
];
$common = new Common();
$token = $common->encrypt($param);
$res = Http::withoutVerifying()->get($url, ['token' => $token])->json();
if(empty($res['code']) || $res['code'] != 200){
LogUtils::error('ProjectToHagro error', $res);
}
}
}
... ...