scene('code')->check(input())){ showJson(1004, $validate->getError()); } // 场景验证 switch ($scene) { case 'code': // 完善信息注册 case 'reg': // 账号注册 $id = Member::where(['mobile' => $mobile]) ->where(function($query) { $query->where(['agent_type'=> 0])->whereOr(['agent_type'=> 1, 'is_reg_profile'=> 1]); }) ->where('user_status','>=',0) ->value('id'); if ($id && $id != $userId) { showJson(1004, 2001); } if($id && $id == $userId){ showJson(1004, 2000); } break; case 'marketReg': // 分销账号注册 $id = Member::where(['user_login' => $mobile,'agent_type'=> 1])->where('agent_status','in',[0,1,2])->value('id'); if ($id && $id != $userId) { showJson(1004, 2001); } if($id && $id == $userId){ showJson(1004, 2000); } break; case 'login': // 登录 case 'fpwd': // 找回密码 case 'mpwd': // 修改密码 if (!Member::where(['mobile' => $mobile])->value('id')) { showJson(1004, 2013); } break; } // 发送处理 $result = Sms::sendCode($mobile, ['tpName' => 'code'], $scene); if (!is_array($result)) { showJson(1004, is_numeric($result) ? $result : 1009); } showJson(1005, 2016); } } ?>