mzeros b8c34de8c8 refactor(merchant): 优化账户数据处理和订单逻辑
- 添加 endsWithDoubleZero 函数,用于处理数值字符串末尾的两个零
- 修改 Core.php 中的 queue 方法,增加对卡库提单的特殊处理逻辑
-调整 Feedov.php 中的订单查询和充值逻辑,提高系统稳定性
- 优化数据库配置,连接测试数据库以确保数据安全
2025-02-15 19:00:17 +08:00

627 lines
32 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace app\private_api\controller\robotApi;
use app\channel\service\ChannelService;
use app\core\Service;
use app\gateway\service\RedisService;
use app\merchant\service\MerchantLogService;
use app\merchant\service\MerchantService;
use app\merchant\service\OrderLastweekHistoryService;
use app\order\service\OrderService;
use think\exception\HttpResponseException;
use app\robot\controller\WeChatBot as WeChatBotC;
use app\robot\service\WeChatService;
/**
* 接口处理
* Class Handle
* @package app\gateway\api
*/
class WeChatBot extends Core
{
# 是否检测数据
protected bool $check = false;
protected array $robotInfo = [];
# 获取机器人信息
public function getRobotInfo($token)
{
$redisKey = 'wechat_robot_info_' . $token;
$robotInfo = $this->redis->get($redisKey);
if ($robotInfo === false) {
$WeChatService = WeChatService::instance();
// 如果 Redis 连接失败或没有找到机器人信息,从数据库中获取
$robotInfo = $WeChatService->getInfo($token);
if($robotInfo && $robotInfo['status'] == 1){
// 将获取到的信息存入 Redis以便下次快速访问
$this->redis->set($redisKey, json_encode($robotInfo), 3600);
} else {
return false;
}
} else {
$robotInfo = json_decode($robotInfo, true);
}
return $robotInfo;
}
public function Call()
{
$RobotService = new WeChatBotC($this->app);
$data = input();
// if(isset($data['token'])){
// $robotInfo = $this->getRobotInfo($data['token']);
// if($robotInfo){
// $this->robotInfo = $robotInfo;
// }else{
// return $this->response(['code'=>-1,'msg'=>'机器人不存在']);
// }
// }else{
// return $this->response(['code'=>-1,'msg'=>'参数错误']);
// }
# 判断是否为群组
if($data['is_group']){
$roomid = $data['roomid'];
if( str_contains($data['xml'],'wxid_9iv1hha8g3ok29')){
$merchantService = MerchantService::instance();
$check_merchant = $merchantService->db()->whereLike('other_param', '%'.$roomid.'%')->findOrEmpty();
if($check_merchant){
$ac = $RobotService->get_contacts($data['sender']) ;
if(!$ac){
$ac = '';
}
if($roomid == '47576792968@chatroom'){
#内部群
if(str_starts_with($data['content'], '@发财-庚辰小秘设置管理 ') ||str_starts_with($data['content'], '@发财-庚辰小秘 设置管理 ') ||($data['content'] == '@发财-庚辰小秘登记管理'||$data['content'] == '@发财-庚辰小秘 登记管理')){
$redis = RedisService::getInstance();
if($data['sender'] !== '25984982683393974@openim' && ($data['content'] == '@发财-庚辰小秘登记管理'||$data['content'] == '@发财-庚辰小秘 登记管理')){
$name = $RobotService->get_contacts($data['sender']);
$randomNumber = mt_rand(100000, 999999);
$redis->set('wechat_wait_set_manage_'.$randomNumber,$data['sender'],300);
return $RobotService->send_text('登记成功,请联系超级管理员输入验证码【 '.$randomNumber.'】设置管理员,验证码五分钟内有效。@'.$name,$data['roomid'],$data['sender']);
}elseif(($data['content'] == '@发财-庚辰小秘登记管理'||$data['content'] == '@发财-庚辰小秘 登记管理')){
return $RobotService->send_text('无需登记',$data['roomid'],$data['sender']);
}else{
$newString = strstr($data['content'], '设置管理 ');
if ($newString) {
$newString = substr($newString, strlen('设置管理 '));
}else{
$this->response(['code'=>1]);
}
$waitManage = $redis->get('wechat_wait_set_manage_'.$newString) ;
if(!$waitManage){
return $RobotService->send_text('验证码错误或者超时,请重新获取',$data['roomid'],$data['sender']);
}
$set = $RobotService->set_manage($waitManage,1) ;
if($set == 'fail'){
return $RobotService->send_text('设置管理失败,请重新设置',$data['roomid'],$data['sender']);
}
if($set == 'ok'){
$acm = $RobotService->get_contacts($waitManage) ;
return $RobotService->send_text('设置管理成功,管理员名为:'.$acm,$data['roomid'],$data['sender']);
}
return $RobotService->send_text('其他提示:'.$set,$data['roomid'],$data['sender']);
}
}
if(str_starts_with($data['content'], '@发财-庚辰小秘设置门禁 ') ||str_starts_with($data['content'], '@发财-庚辰小秘 设置门禁 ') ||($data['content'] == '@发财-庚辰小秘登记门禁'||$data['content'] == '@发财-庚辰小秘 登记门禁')){
$redis = RedisService::getInstance();
if($data['sender'] !== '25984982683393974@openim' && ($data['content'] == '@发财-庚辰小秘登记门禁'||$data['content'] == '@发财-庚辰小秘 登记门禁')){
$name = $RobotService->get_contacts($data['sender']);
$randomNumber = mt_rand(100000, 999999);
$redis->set('gcdat_wait_set_EntranceGuard_'.$randomNumber,$data['sender'],300);
return $RobotService->send_text('登记成功,请联系超级管理员输入验证码【 '.$randomNumber.'】设置门禁,验证码五分钟内有效。@'.$name,$data['roomid'],$data['sender']);
}elseif(($data['content'] == '@发财-庚辰小秘设置门禁'||$data['content'] == '@发财-庚辰小秘 设置门禁')){
return $RobotService->send_text('无需登记',$data['roomid'],$data['sender']);
}else{
$newString = strstr($data['content'], '设置门禁 ');
if ($newString) {
$newString = substr($newString, strlen('设置门禁 '));
}else{
$this->response(['code'=>1]);
}
$waitManage = $redis->get('gcdat_wait_set_EntranceGuard_'.$newString) ;
if(!$waitManage){
return $RobotService->send_text('验证码错误或者超时,请重新获取',$data['roomid'],$data['sender']);
}
$redis->delete('gcdat_wait_set_EntranceGuard_'.$newString);
$name = $RobotService->get_contacts($waitManage);
if($name){
$get = $redis->get('GCDAT_EntranceGuard_' . $waitManage);
if($get){
if($get != $name){
$redis->set('GCDAT_EntranceGuard_' . $waitManage, $name);
}
return $RobotService->send_text('已经登记过门禁,无法重新设置',$data['roomid'],$data['sender']);
}
$redis->set('GCDAT_EntranceGuard_' . $waitManage, $name);
$RobotService->send_text('登记门禁成功,门禁名为:'.$name,$data['roomid'],$data['sender']);
return $RobotService->send_text('欢迎您登记GCDAT门禁系统您的门禁名为【'.$name."\n您以后可以使用【开门】指令进行门禁操作,权限只限于您排班当天,且私聊即可使用,非排班时间请于本群发出【开门】指令。",$data['roomid'],$waitManage);
}
}
return $RobotService->send_text('其他提示:设置失败或者其他错误',$data['roomid'],$data['sender']);
}
if(str_starts_with($data['content'], '@发财-庚辰小秘通知 ') ||str_starts_with($data['content'], '@发财-庚辰小秘 通知 ')||str_starts_with($data['content'], '@发财-庚辰小秘通知全部 ')){
$newString = strstr($data['content'], '通知全部 ');
if ($newString) {
$newString = substr($newString, strlen('通知全部 '));
}else{
$newString = strstr($data['content'], '通知 ');
if ($newString) {
$newString = substr($newString, strlen('通知 '));
}else{
$this->response(['code'=>1]);
}
}
$merchantsList = $merchantService->db()->where(['merchant_type'=>1,'status'=>1])->whereLike('other_param','%Monitor_Balance_status%')->select()->toArray();
if(!$merchantsList)return $this->response(['code'=>1]);
$tip_info=[];
$num = 0;
foreach ($merchantsList as $merchant){
$other_param = json_decode($merchant['other_param'],true);
$roomids = $other_param['QYWX_roomid'];
$sender = $other_param['QYWX_sender'];
if($roomids == $roomid){
continue;
}
// $acm = '';
$acm = $RobotService->get_contacts($sender) ;
if(!$acm){
$acm = '';
}
$RobotService->send_text("通知 \n ".$newString."\n 时间:".date('Y-m-d H:i:s')."\n @".$acm,$roomids,$sender);
$tip_info[]=$merchant['name'];
$num++;
}
$merchant_name = implode("\n", $tip_info);
return $RobotService->send_text('通知完毕 共通知了'.$num."个商户:\n".$merchant_name.'@'.$ac,$data['roomid'],$data['sender']);
}
if(str_ends_with($data['content'], '余额') ){
if(str_ends_with($data['content'], '商户余额')){
$merchantsList = $merchantService->db()->where(['status'=>1])->whereLike('other_param','%Monitor_Balance_status%')->select()->toArray();
if(!$merchantsList)return $RobotService->send_text('暂无可查询商户@'.$ac,$data['roomid'],$data['sender']);
$tip_info=[];
foreach ($merchantsList as $merchant){
$tip_info[]="商户:[".$merchant['name']."] --【".$merchant['account_surplus'].'】';
}
if(!$tip_info)return $RobotService->send_text('暂无可查询商户@'.$ac,$data['roomid'],$data['sender']);
$tip_infos = implode("\n", $tip_info);
return $RobotService->send_text("商户余额查询完毕:\n".$tip_infos."\n@".$ac,$data['roomid'],$data['sender']);
}
$channelService = ChannelService::instance();
$channelList = $channelService->db()->where(['status'=>1])->whereLike('other_data','%Monitor_Balance_status%')->select()->toArray();
if(!$channelList)return $RobotService->send_text('暂无可查询渠道@'.$ac,$data['roomid'],$data['sender']);
$count_sum= 0;
$day = date('Y-m-d', strtotime('-1 day'));
$tip_info=[];
foreach($channelList as $channel) {
$other_param = json_decode($channel['other_data'], true);
if (!$other_param) {
continue;
}
$Monitor_Balance = $other_param['Monitor_Balance'] ?? null;
if (!$Monitor_Balance) {
continue;
}
try {
$account_data = $channelService->call('account', $channel['id'], $day);
if (is_array($account_data) && isset($account_data['account'])) {
$balance = $account_data['account'];
$tip_info[]='渠道:['.$channel['name']."] \n余额:【".$balance.'】元';
$count_sum++;
}
}catch (\Exception $e){
}
}
if(!$tip_info)return $RobotService->send_text('暂无可查询渠道@'.$ac,$data['roomid'],$data['sender']);
$errorMsg = implode("\n", $tip_info);
return $RobotService->send_text("渠道余额查询完毕,共查询了".$count_sum."个渠道:\n".$errorMsg."\n@".$ac,$data['roomid'],$data['sender']);
}
if(str_ends_with($data['content'], '成本')){
return $RobotService->send_text("成本报价测试@".$ac,$data['roomid'],$data['sender']);
}
}
if(str_ends_with($data['content'], '余额') || str_ends_with($data['content'],'查余额')){
return $RobotService->send_text("商户[".$check_merchant['name']."] : \n 余额为:".$check_merchant['account_surplus']." @".$ac,$data['roomid'],$data['sender']);
}
if(str_starts_with($data['content'], '@发财-庚辰小秘1')||str_starts_with($data['content'], '@发财-庚辰小秘 1')){
$newString = strstr($data['content'], '1');
if (preg_match('/\b1[3-9]\d{9}\b/', $newString)) {
// Log::write('Robot', 'wechat', $data);
#查询订单
$msg = [];
$orderService = OrderService::instance();
$order = $orderService->db()->field('cid,pid,mid,order_id,merchant_order_id,param,account,cash,status,channel_callback_at,create_at')->where(['account'=>$newString,'mid'=>$check_merchant['id']])->select()->toArray();
if(!$order){
$orderLastweekHistoryService = OrderLastweekHistoryService::instance();
$order = $orderLastweekHistoryService->db()->field('cid,pid,mid,order_id,merchant_order_id,param,account,cash,status,channel_callback_at,create_at')->where(['account'=>$newString,'mid'=>$check_merchant['id']])->select()->toArray();
}
if(!$order)return $RobotService->send_text("手机号格式正确,但是未找到订单,暂时支持当天和最近一周的订单筛选,更多请前往后台查询 @".$ac,$data['roomid'],$data['sender']);
if (count($order) == 1) {
$orders = $order[0];
$infos =$orderService->getOrderInfo($orders['cid'],$orders['mid'],$orders['pid']);
$msg = [
'系统订单号:' . $orders['order_id'],
'产品:' . $infos['p']['name']??'',
'商户订单号:' . $orders['merchant_order_id'],
'手机号:' . $orders['account'],
'订单金额:' . $orders['cash'],
'订单状态:' . ($orders['status'] == 2 ? '成功' : ($orders['status'] == 3 ? '失败' : '处理中')),
'订单时间:' . $orders['create_at'],
];
if(str_contains($orders['param'], 'mnp_isp_array')){
$param_data = json_decode($orders['param'],true);
if($param_data['mnp_isp_array']['old_isp'] == $param_data['mnp_isp_array']['new_isp']){
$msg[] = '携转检测:未携转';
}else{
$msg[] = '携转检测:已携转';
$isp_name = [
1=>'移动',
2=>'联通',
3=>'电信',
];
$msg[] = '旧运营商:'.$isp_name[$param_data['mnp_isp_array']['old_isp']??0] ?? '';
$msg[] = '新运营商:'.$isp_name[$param_data['mnp_isp_array']['new_isp']??0] ?? '';
}
}
if(isset($orders['channel_callback_at']) && $orders['channel_callback_at']){
$msg[] = '完成时间:'.$orders['channel_callback_at'];
}
$m_msg= implode("\n", $msg);
return $RobotService->send_text("已为您查询到订单信息:\n".$m_msg." \n@".$ac, $data['roomid'], $data['sender']);
} else {
return $RobotService->send_text("手机号格式正确,查询到多条订单,暂时只支持单条查询,更多请前往后台查询 @".$ac,$data['roomid'],$data['sender']);
// foreach ($order as $singleOrder) {
// // 在这里处理每一条订单数据
// // 例如:$RobotService->send_text("订单信息: " . $singleOrder['some_field'], $data['roomid'], $data['sender']);
// }
}
}
}
if(str_starts_with($data['content'], '@发财-庚辰小秘检测 ')||str_starts_with($data['content'], '@发财-庚辰小秘 检测 ')){
$newString = strstr($data['content'], '1');
if (!preg_match('/\b1[3-9]\d{9}\b/', $newString)) return $RobotService->send_text("暂时只支持手机号码检测,其他请联系管理员 @".$ac,$data['roomid'],$data['sender']);
$settingPhoneMNPStatus = sysconf('settingPhoneMNPStatus');
if ($settingPhoneMNPStatus == 1) {
$mnp_cid = sysconf('PhoneMnp_cid');
$param = [
'mobile' => $newString,
];
if ($mnp_cid) {
$mnp_array = ChannelService::instance()->call('phone_mnp', $mnp_cid, $param);
if (is_array($mnp_array) && isset($mnp_array['new_isp'])) {
$msg = [
'手机号:' . $newString,
'是否携转:' . ($mnp_array['new_isp'] == $mnp_array['old_isp'] ? '否' : '是'),
'旧运营商:' . ($mnp_array['old_isp'] == 1 ? '移动' : ($mnp_array['old_isp'] == 2 ? '联通' : '电信')),
'新运营商:' . ($mnp_array['new_isp'] == 1 ? '移动' : ($mnp_array['new_isp'] == 2 ? '联通' : '电信')),
];
$m_msg= implode("\n", $msg);
return $RobotService->send_text("已经为您查询到手机号信息:\n".$m_msg." \n@".$ac, $data['roomid'], $data['sender']);
}
}
}
$isp = Service::instance()->isp($newString);
$msg = [
'手机号:' . $newString,
'是否携转:' . '未携转或者无法查询',
'运营商:' . ($isp == 1 ? '移动' : ($isp == 2 ? '联通' : '电信')),
];
$m_msg= implode("\n", $msg);
return $RobotService->send_text("已经为您查询到手机号信息:\n".$m_msg." \n@", $data['roomid'], $data['sender']);
}
$need_Manage_list = [
'返销','加款'
];
if(str_starts_with($data['content'], '@发财-庚辰小秘 ')){
$need_content = substr($data['content'], strlen('@发财-庚辰小秘 '));
}elseif(str_starts_with($data['content'], '@发财-庚辰小秘')){
$need_content = substr($data['content'], strlen('@发财-庚辰小秘'));
}else{
$need_content = false;
}
foreach ($need_Manage_list as $need_Manage){
if($need_content && str_starts_with($need_content, $need_Manage)){
$redis = RedisService::getInstance();
$is_manage = $redis->get('Wechat_manage_'.$data['sender']);
if(!$is_manage){
return $RobotService->send_text('您没有权限 @'.$ac,$data['roomid'],$data['sender']);
}
if(str_starts_with($need_content, '返销 GC')){
$order_id = substr($need_content, strlen('返销 '));
$orderService = OrderService::instance();
$order = $orderService->db()->field('id,pid,mid,order_id,merchant_order_id,product_key,account,cash,status,project_id,isp,channel_callback_at,create_at,buy_back')->where(['order_id'=>$order_id,'mid'=>$check_merchant['id']])->findOrEmpty();
if(!$order){
$orderService = OrderLastweekHistoryService::instance();
$order = $orderService->db()->field('id,cid,pid,mid,order_id,merchant_order_id,product_key,account,cash,status,project_id,isp,channel_callback_at,create_at,buy_back')->where(['order_id'=>$order_id,'mid'=>$check_merchant['id']])->findOrEmpty();
if(!$order){
return $RobotService->send_text('订单不存在,或者超过七天,超七天订单需要返销请前往后台手动处理 @'.$ac,$data['roomid'],$data['sender']);
}
}
if($order['status'] != 2){
return $RobotService->send_text('订单状态不是成功,无法返销 @'.$ac,$data['roomid'],$data['sender']);
}
if(isset($order['buy_back']) && $order['buy_back'] == 1){
return $RobotService->send_text('订单已经返销,无需重复返销 @'.$ac,$data['roomid'],$data['sender']);
}
$state = MerchantService::instance()->buyBackFrozenAccount($order['id'], $order['order_id'], $order['mid'], $order['pid'], $order['product_key'], $order['cash'], $order['project_id'], $order['account'], $order['isp']);
if ($state) {
$log['type'] = 'account_fail';
$log['data'] = $order;
$log['msg'] = '返销';
$this->log($log);
$orderService->db()->where(['order_id'=>$order_id,'mid'=>$check_merchant['id']])->update(['status'=>3,'buy_back'=>1]);
$check_merchants = $merchantService->db()->whereLike('other_param', '%'.$roomid.'%')->findOrEmpty();
return $RobotService->send_text("返销成功! \n返销订单:".$order_id."\n商户订单:".$order['merchant_order_id']."\n账号:".$order['account']."\n返销金额:".$state."\n返销后余额:".$check_merchants['account_surplus']."\n@".$ac,$data['roomid'],$data['sender']);
}
return $RobotService->send_text('返销失败,请后台人工核查 @'.$ac,$data['roomid'],$data['sender']);
}
if(str_starts_with($need_content, '加款 ')){
#加款格式 金额 备注
$jk_data = explode(' ', $need_content);
if($jk_data[0] != '加款'){
return $RobotService->send_text('加款格式错误@'.$ac,$data['roomid'],$data['sender']);
}
$jk_money = $jk_data[1];
if(!$jk_money || !is_numeric($jk_money)){
return $RobotService->send_text('加款金额错误@'.$ac,$data['roomid'],$data['sender']);
}
if(!$jk_data[2]){
$desc = '机器人加款,加款人:'.$ac;
}else{
$desc = $jk_data[2].',操作人:'.$ac;
}
if (MerchantLogService::instance()->add($check_merchant['id'], $jk_money, 1,1,$desc) !== false) {
sysoplog('修改金额', '加款金额:'.$jk_money.'元,类型为:'. '余额账户');
$check_merchants = $merchantService->db()->where(['id'=>$check_merchant['id']])->findOrEmpty();
return $RobotService->send_text("加款成功! \n加款金额:【".$jk_money."】元 \n加款描述:".$desc."\n加款操作人:".$ac."\n加款时间:".date('Y-m-d H:i:s')."\n加款前余额:".$check_merchant['account_surplus']."\n加款后余额:".$check_merchants['account_surplus']."\n@".$ac,$data['roomid'],$data['sender']);
}
}
return $RobotService->send_text('测试权限设置 @'.$ac,$data['roomid'],$data['sender']);
}
}
return $RobotService->send_text('测试自动回复 @'.$ac,$data['roomid'],$data['sender']);
}else{
$ChannelService = ChannelService::instance();
$check_channel = $ChannelService->db()->whereLike('other_data', '%'.$roomid.'%')->findOrEmpty();
if($check_channel){
return $this->channel_logic($roomid, $check_channel, $data);
}
}
}
$this->response(['code'=>1]);
}
$this->response($data);
}
public function channel_logic($roomid,$check_channel,$data)
{
$RobotService = new WeChatBotC($this->app);
$ac = $RobotService->get_contacts($data['sender']) ;
if(!$ac){
$ac = '';
}
if(str_starts_with($data['content'], '@发财-庚辰小秘检测 ')||str_starts_with($data['content'], '@发财-庚辰小秘 检测 ')){
$newString = strstr($data['content'], '1');
if (!preg_match('/\b1[3-9]\d{9}\b/', $newString)) return $RobotService->send_text("暂时只支持手机号码检测,其他请联系管理员 @".$ac,$data['roomid'],$data['sender']);
$settingPhoneMNPStatus = sysconf('settingPhoneMNPStatus');
if ($settingPhoneMNPStatus == 1) {
$mnp_cid = sysconf('PhoneMnp_cid');
$param = [
'mobile' => $newString,
];
if ($mnp_cid) {
$mnp_array = ChannelService::instance()->call('phone_mnp', $mnp_cid, $param);
if (is_array($mnp_array) && isset($mnp_array['new_isp'])) {
$msg = [
'手机号:' . $newString,
'是否携转:' . ($mnp_array['new_isp'] == $mnp_array['old_isp'] ? '否' : '是'),
'旧运营商:' . ($mnp_array['old_isp'] == 1 ? '移动' : ($mnp_array['old_isp'] == 2 ? '联通' : '电信')),
'新运营商:' . ($mnp_array['new_isp'] == 1 ? '移动' : ($mnp_array['new_isp'] == 2 ? '联通' : '电信')),
];
$m_msg= implode("\n", $msg);
return $RobotService->send_text("已经为您查询到手机号信息:\n".$m_msg." \n@".$ac, $data['roomid'], $data['sender']);
}
}
}
$isp = Service::instance()->isp($newString);
$msg = [
'手机号:' . $newString,
'是否携转:' . '未携转或者无法查询',
'运营商:' . ($isp == 1 ? '移动' : ($isp == 2 ? '联通' : '电信')),
];
$m_msg= implode("\n", $msg);
return $RobotService->send_text("已经为您查询到手机号信息:\n".$m_msg." \n@", $data['roomid'], $data['sender']);
}
return $RobotService->send_text('输入指令有误,或者其他错误! @'.$ac,$data['roomid'],$data['sender']);
}
public function manage_logic($openid)
{
}
public function response($result)
{
throw new HttpResponseException(json($result));
}
protected function maketime($v): float|false|int|string
{
if (!$v) {
return '';
}
if (is_numeric($v)) {
return $v;
}
if (is_array($v)) {
$v = $v[1];
}
if (strstr($v, ' ')) {
$t = explode(' ', $v);
$v = $t[0];
$s = explode(':', $t[1]);
} else {
$s = array(0, 0, 0);
}
if (!isset($s[1])) {
$s[1] = 0;
}
if (!isset($s[2])) {
$s[2] = 0;
}
if (strstr($v, '-')) {
$t = explode('-', $v);
} elseif (strstr($v, '/')) {
$u = explode('/', $v);
$t[0] = $u[2];
$t[1] = $u[0];
$t[2] = $u[1];
}
if (!isset($t)) {
$t = array(0, 0, 0);
}
if (!isset($t[1])) {
$t[1] = 0;
}
if (!isset($t[2])) {
$t[2] = 0;
}
return mktime($s[0], $s[1], $s[2], $t[1], $t[2], $t[0]);
}
}