正在显示
1 个修改的文件
包含
66 行增加
和
0 行删除
| @@ -16,6 +16,7 @@ use App\Helper\Common; | @@ -16,6 +16,7 @@ use App\Helper\Common; | ||
| 16 | use App\Helper\Translate; | 16 | use App\Helper\Translate; |
| 17 | use App\Helper\Wechat; | 17 | use App\Helper\Wechat; |
| 18 | use App\Http\Logic\Bside\User\UserLoginLogic; | 18 | use App\Http\Logic\Bside\User\UserLoginLogic; |
| 19 | +use App\Models\Channel\Channel; | ||
| 19 | use App\Models\Domain\DomainInfo; | 20 | use App\Models\Domain\DomainInfo; |
| 20 | use App\Models\Project\Project; | 21 | use App\Models\Project\Project; |
| 21 | use App\Models\Service\Service; | 22 | use App\Models\Service\Service; |
| @@ -24,7 +25,9 @@ use App\Models\User\DeptUser; | @@ -24,7 +25,9 @@ use App\Models\User\DeptUser; | ||
| 24 | use App\Models\User\ProjectRole; | 25 | use App\Models\User\ProjectRole; |
| 25 | use App\Models\User\User; | 26 | use App\Models\User\User; |
| 26 | use App\Utils\EncryptUtils; | 27 | use App\Utils\EncryptUtils; |
| 28 | +use App\Utils\LogUtils; | ||
| 27 | use Illuminate\Support\Facades\Cache; | 29 | use Illuminate\Support\Facades\Cache; |
| 30 | +use Illuminate\Support\Facades\Http; | ||
| 28 | use Mrgoon\AliSms\AliSms; | 31 | use Mrgoon\AliSms\AliSms; |
| 29 | 32 | ||
| 30 | class LoginController extends BaseController | 33 | class LoginController extends BaseController |
| @@ -299,4 +302,67 @@ class LoginController extends BaseController | @@ -299,4 +302,67 @@ class LoginController extends BaseController | ||
| 299 | } | 302 | } |
| 300 | return $data; | 303 | return $data; |
| 301 | } | 304 | } |
| 305 | + | ||
| 306 | + | ||
| 307 | + public function ceshi(){ | ||
| 308 | + $this->toAicc(); | ||
| 309 | + $this->toHagro(); | ||
| 310 | + $this->response('success'); | ||
| 311 | + } | ||
| 312 | + /** | ||
| 313 | + * 同步到AICC | ||
| 314 | + * @param $data | ||
| 315 | + * @author zbj | ||
| 316 | + * @date 2023/9/1 | ||
| 317 | + */ | ||
| 318 | + public function toAicc(){ | ||
| 319 | + $url = 'https://biz.ai.cc/api/sync_company_for_order'; | ||
| 320 | + $param = [ | ||
| 321 | + 'company_name' => '西安奥谷生物科技有限公司', | ||
| 322 | + 'company_address' => '', | ||
| 323 | + 'company_tel' => '18091843361', | ||
| 324 | + 'company_email' => '', | ||
| 325 | + 'remark' => '', | ||
| 326 | + 'level_id' => 6, | ||
| 327 | + 'level_day' => 1095, | ||
| 328 | + 'from_order_id' => '64ffd2db6dde4', | ||
| 329 | + ]; | ||
| 330 | + //sign | ||
| 331 | + ksort($param); | ||
| 332 | + $tem = []; | ||
| 333 | + foreach ($param as $key => $val) { | ||
| 334 | + $tem[] = $key . '=' . urlencode($val); | ||
| 335 | + } | ||
| 336 | + $string = implode('&', $tem); | ||
| 337 | + $key = md5('quanqiusou.com'); | ||
| 338 | + $param['sign'] = md5($string . $key); | ||
| 339 | + $res = Http::withoutVerifying()->post($url, $param)->json(); | ||
| 340 | + if(empty($res['status']) || $res['status'] != 200){ | ||
| 341 | + LogUtils::error('ProjectToAicc error', $res); | ||
| 342 | + } | ||
| 343 | + } | ||
| 344 | + | ||
| 345 | + /** | ||
| 346 | + * 同步到Hagro | ||
| 347 | + * @param $data | ||
| 348 | + * @author zbj | ||
| 349 | + * @date 2023/9/1 | ||
| 350 | + */ | ||
| 351 | + public function toHagro(){ | ||
| 352 | + $url = 'https://admin.hagro.cn/globalso/create_project'; | ||
| 353 | + $param = [ | ||
| 354 | + 'company' => '西安奥谷生物科技有限公司', | ||
| 355 | + 'phone' => '18091843361', | ||
| 356 | + 'planday' => 1095 ?: 1, | ||
| 357 | + 'from_order_id' => '64ffd2db6dde4', | ||
| 358 | + 'agent_phone' => Channel::where('source_id',217)->value('contact_mobile') ?: '', | ||
| 359 | + ]; | ||
| 360 | + $common = new Common(); | ||
| 361 | + $token = $common->encrypt($param); | ||
| 362 | + $res = Http::withoutVerifying()->get($url, ['token' => $token])->json(); | ||
| 363 | + if(empty($res['code']) || $res['code'] != 200){ | ||
| 364 | + LogUtils::error('ProjectToHagro error', $res); | ||
| 365 | + } | ||
| 366 | + } | ||
| 367 | + | ||
| 302 | } | 368 | } |
-
请 注册 或 登录 后发表评论