修复管理员手动确认订单

This commit is contained in:
root
2025-05-22 17:31:02 +00:00
parent 248851f4ce
commit cf6049376e
+76
View File
@@ -2198,7 +2198,83 @@ TG ID <code>{$from['id']}</code>
// $this->db->update('order',['message_id' => $isid],['order_no' => $order_no]); // $this->db->update('order',['message_id' => $isid],['order_no' => $order_no]);
Db::name('order')->where("order_no", $order_no)->update(['message_id' => $isid]); Db::name('order')->where("order_no", $order_no)->update(['message_id' => $isid]);
}elseif($moth == "admin"){
$odder = Db::name('order')->where("order_no", $order_no)->find();
if ($this->bots['botad'] == $callback_from['id']) {
Db::name('order')->where(['order_no' => $order_no])->update(['start' => 1, "remakess" => "管理员手动"]);
if ($odder['moth'] == "huiyuangoumaai") {
$tmuid = Db::name("conf")->where("key", 'tmuid')->value('value');
$tmkey = Db::name("conf")->where("key", 'tmkey')->value('value');
$cycleMap = ['3' => '0', '6' => '1', '12' => '2'];
$mappedValue = $cycleMap[$odder['tancan']] ?? '3';
$reqx = $this->Customer->submitkt($tmuid, $tmkey,$this->bots['botid'],$order_no,$odder['money'], $odder['username'], $mappedValue, $this->bots['apiurl']);
if ($reqx['code'] == 0) {
Db::name('order')->where("order_no", $order_no)->update(['start' => 1]);
$this->telegram->sendMessage($this->bots['botad'], $reqx['msg'] . "\r\n" . "单号:<code>" . $order_no . "</code>" . "\r\n" . "用户名:<code>" . $odder['username'] . "</code>" . "\r\n" . "开通时间:<code>" . $odder['tancan'] . "</code>" . "\r\n" . "消费金额:<code>" . $odder['money'] . "</code>" . "\r\n" . "处理方法:充值余额后手动提交给机器人代替客户开通");
//return true;
$this->telegram->sendMessage($odder['userid'], "订单提交成功!请联系客服,尽快处理!单号:<code>" . $order_no . "</code>");
} else {
$this->telegram->sendMessage($odder['userid'], $reqx['msg']);
//return true;
} }
}
if ($odder['moth'] == 'pkaihuiy') {
if(!cache::get($odder['moth'].$order_no)){
$tmuid = Db::name("conf")->where("key", 'tmuid')->value('value');
$tmkey = Db::name("conf")->where("key", 'tmkey')->value('value');
$cycleMap = ['3' => '0', '6' => '1', '12' => '2'];
$mappedValue = $cycleMap[$odder['tancan']] ?? '3';
cache::set($odder['moth'].$order_no,$odder['userid'],5);
$dakai = json_decode($odder['username'], true);
foreach ($dakai as $key => $value) {
$reqx = $this->Customer->submitkt($tmuid, $tmkey,$this->bots['botid'],$order_no,$odder['danprice'], "@" . $value, $mappedValue, $this->bots['apiurl']);
if ($reqx['code'] == 0) {
$this->telegram->sendMessage($this->bots['botad'], $reqx['msg'] . "\r\n" . "单号:<code>" . $order_no . "</code>" . "\r\n" . "用户名:<code>" . $odder['username'] . "</code>" . "\r\n" . "开通时间:<code>" . $odder['tancan'] . "</code>" . "\r\n" . "消费金额:<code>" . $odder['money'] . "</code>" . "\r\n" . "处理方法:充值余额后手动提交给机器人代替客户开通");
//return true;
$this->telegram->sendMessage($odder['userid'], "订单提交成功!请联系客服,尽快处理!单号:<code>" . $order_no . "</code>");
} else {
$this->telegram->sendMessage($odder['userid'], $reqx['msg']);
//return true;
}
}
}else{
$this->telegram->answerCallback($callback_id, "消息已处理", true);
}
}
$this->telegram->deleteMessage($chat['id'], $message_id);
$this->telegram->answerCallback($callback_id, "已经提交了", true);
} else {
$this->telegram->answerCallback($callback_id, "没你啥事儿啊", true);
// return true;
}
//如果余额 够 直接
// $user= $this->db->select('user_money',"*",['userid' =>$odder['userid']]);
return true;
}
} }
if ($tou == "otherpay") { if ($tou == "otherpay") {
$order_no = $callbackExplode[1]; $order_no = $callbackExplode[1];