修改返利发放

This commit is contained in:
邹景立 2021-03-24 16:41:34 +08:00
parent 8e1406077e
commit 41230a61df
2 changed files with 4 additions and 3 deletions

View File

@ -42,9 +42,10 @@ class UserRebateService extends Service
*/
public function confirm(string $orderNo): array
{
$map = ['order_no' => $orderNo, 'status' => 6];
$map = [['status', '>', 3], ['order_no', '=', $orderNo]];
$order = $this->app->db->name('ShopOrder')->where($map)->find();
if (empty($order)) return [0, '需处理的订单状态异常!'];
$map = [['status', '=', 0], ['order_no', 'like', "{$orderNo}%"]];
$this->app->db->name('DataUserRebate')->where($map)->update(['status' => 1]);
if (UserUpgradeService::instance()->upgrade($order['uid'])) {

View File

@ -63,10 +63,10 @@ class BalancePyamentService extends PaymentService
data_save('DataUserBalance', [
'uid' => $order['uid'],
'code' => $order['order_no'],
'name' => "订单余额支付",
'name' => "账户余额支付",
'remark' => "使用余额支付订单{$order['order_no']}金额{$paymentAmount}",
'amount' => -$paymentAmount,
], 'code', ['name' => '订单余额支付']);
], 'code', ['name' => '账户余额支付']);
// 更新支付行为
$this->updatePaymentAction($orderNo, CodeExtend::uniqidDate(20), $paymentAmount, '账户余额支付');
// 刷新用户余额