短信异常修复

This commit is contained in:
jianghanbo 2024-08-11 17:37:32 +08:00
parent e7e757dbfc
commit 9fe2effc94
1 changed files with 7 additions and 5 deletions

View File

@ -10,7 +10,7 @@ use support\Log;
use support\Redis; use support\Redis;
class Orders { class Orders {
public static function isDaishiyong(OrdersModel $order): bool public static function isDaishiyong(OrdersModel $order): bool
{ {
// 根据 OrdersModel::AllOssStatusSql[1] 进行判断 // 根据 OrdersModel::AllOssStatusSql[1] 进行判断
// ((os=1 and order_status=3) or (os=2 and order_status=4) or (os=3 and order_status=1)) // ((os=1 and order_status=3) or (os=2 and order_status=4) or (os=3 and order_status=1))
@ -23,7 +23,7 @@ class Orders {
* @params []OrdersModel $order * @params []OrdersModel $order
* @return array * @return array
*/ */
public static function reminderOrders(OrdersModel ...$orders) public static function reminderOrders(OrdersModel ...$orders)
{ {
$admin_ids = []; $admin_ids = [];
$sns = []; $sns = [];
@ -42,6 +42,7 @@ class Orders {
$ttl = 86400; $ttl = 86400;
$result = []; $result = [];
$admins = array_column($admins, null, 'id');
foreach($orders as $order) { foreach($orders as $order) {
$admin_mobile = $admins[$order->admin_id] ?? ''; $admin_mobile = $admins[$order->admin_id] ?? '';
@ -49,6 +50,7 @@ class Orders {
$result[$order->sn] = Error::undefined('client mobile or admin mobile invalid'); $result[$order->sn] = Error::undefined('client mobile or admin mobile invalid');
continue; continue;
} }
$admin_mobile = $admin_mobile['mobile'] ?? '';
if (Blacks::CExists($order->mobile)) { if (Blacks::CExists($order->mobile)) {
$result[$order->sn] = Error::ERR_SMS_BLACKS; $result[$order->sn] = Error::ERR_SMS_BLACKS;
@ -75,14 +77,14 @@ class Orders {
$result[$order->sn] = []; $result[$order->sn] = [];
} }
return count($orders) > 1 ? $result : reset($result); return count($orders) > 1 ? $result : reset($result);
} }
public static function syncFromThird(OrdersModel $order) public static function syncFromThird(OrdersModel $order)
{ {
$got = null; $got = null;
switch ($order->os) { switch ($order->os) {
case 1: case 1:
$mt = new Meituan(); $mt = new Meituan();
@ -128,7 +130,7 @@ class Orders {
public static function finance($type = 1, $order_id = 0, $price = 0) public static function finance($type = 1, $order_id = 0, $price = 0)
{ {
//总的关于这个订单的金额 //总的关于这个订单的金额
$total = FinancesModel::where('order_id', $order_id)->sum('total'); $total = FinancesModel::where('order_id', $order_id)->sum('total');
//如果总金额大于提交上来的核销金额,那就是退费的 //如果总金额大于提交上来的核销金额,那就是退费的
//如果提交上来的金额小于总金额,那就是核销的 //如果提交上来的金额小于总金额,那就是核销的