| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- /**
- * 发送手机短信
- */
- namespace app\api\controller\v1;
- use app\api\controller\Api;
- use app\common\model\Members;
- use app\common\model\MailLog;
- use app\common\library\Sms;
- use app\common\model\ComplexChannelModel;
- use app\common\model\PolychannelGame;
- use think\Controller;
- use think\Env;
- use think\Exception;
- class SpecialParam extends Controller
- {
- protected $_neekCheckChannel = ['wanxiong'];
- public function getSpecialParam(){
- $log_postdata = '';
- try {
- $postData = input();
- if (!$postData) {
- $postData = request()->getInput();
- }
- foreach ($postData as $k => $v) {
- $log_postdata .= $k . ':' . $v . ' ';
- }
- } catch (\Exception $e) {
- $log_postdata = json_encode($postData);
- }
- log_message('请求:'.request()->url().' '.$log_postdata,'log',LOG_PATH . 'complex/SpecialParam/');
- $prefix = strtolower(input('channel_mark')); // 渠道标识
- $channelModel = new ComplexChannelModel;
- if(!($channel_id=$channelModel->where(['status'=>1,'mark'=>$prefix])->value('id')))
- {
- $this->jsonResult('',0,'渠道信息不存在');
- }
- if(!$polyChannelGame = (new PolychannelGame())->where(['channel_id'=>$channel_id,'game_id'=>$postData['gameid']])->find()){
- $this->jsonResult('',0,'渠道游戏不存在');
- }
- // 判断是否有做登录验证的渠道
- if (in_array($prefix,$this->_neekCheckChannel)){
- try {
- $sentence = ucfirst($prefix);
- $className = 'app\api\complex\\' . $sentence;
- $model = new $className;
- $result = $model->getSpecialParam(input(),$polyChannelGame);
- if($result){
- $this->jsonResultTrue(['cuserid'=>$result],1,'获取成功');
- }else{
- $this->jsonResultTrue('',0,'二次登录验证失败 ');
- }
- }catch (Exception $e){
- curlDD( '渠道支付回调:'. $e->getMessage(),Env::get('dingtalk.warning_url'));
- $this->jsonResultTrue('',0,'二次登录验证失败');
- }
- }else{
- $this->jsonResultTrue('', 1, '');
- }
- }
- public function jsonResultTrue($data, $code = 0, $msg = '',$isExit=true)
- {
- $result = [
- 'code' => $code,
- 'msg' => $msg,
- 'time' => request()->server('REQUEST_TIME'),
- 'data' => $data,
- ];
- //debug模式下返回明文
- echo json_encode($result);
- //为了使用fastcgi_finish_request等函数时,后续的执行能够继续生效
- if($isExit) exit;
- }
- }
|