123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- /**
- * Created by PhpStorm.
- * User: shensong
- * Date: 2022/6/27
- * Time: 11:20
- */
- namespace App\Http\Controllers\Admin;
- use App\Http\Controllers\Controller;
- use App\Log;
- use App\Models\PlatformOrderConf;
- use App\Service\MsgService;
- use App\Service\ThirdPlatformService;
- use Illuminate\Http\Request;
- class ThirdPlatformController extends Controller
- {
- // 修改客户所有标签
- public function updateCustomerTag(Request $request)
- {
- $params['add_tag'] = $request->input('add_tag');
- $params['corpid'] = $request->input('corpid');
- $params['phone'] = $request->input('phone');
- $platformId = $request->input('platform_id');
- $timestamp = $request->input('timestamp');
- $nonce = $request->input('nonce');
- $signature = $request->input('signature');
- // 将接收到的数据保存的日志文件中
- Log::logInfo('updateCustomerTag', $request->all(), 'thirdPlatform');
- // 查询app_id对应的token
- $conf = PlatformOrderConf::getTokenByPlatformId($platformId);
- if(empty($conf->token)) {
- return self::returnValue('平台标识有误', 5000);
- }
- // 数据校验
- $check = MsgService::checkSignatureNew($nonce, $timestamp, $conf->token, $platformId, $signature);
- if($check === false) {
- return self::returnValue('签名校验失败', 5001);
- }
- list($res, $code) = ThirdPlatformService::updateCustomerTag($params);
- return self::returnValue($res, $code);
- }
- }
|