|
|
@@ -16,8 +16,10 @@ namespace app\common\logic;
|
|
|
|
|
|
use app\common\enum\PayEnum;
|
|
|
use app\common\enum\user\AccountLogEnum;
|
|
|
+use app\common\enum\WorkEnum;
|
|
|
use app\common\model\recharge\RechargeOrder;
|
|
|
use app\common\model\user\User;
|
|
|
+use app\common\model\works\ServiceWork;
|
|
|
use think\facade\Db;
|
|
|
use think\facade\Log;
|
|
|
|
|
|
@@ -55,8 +57,6 @@ class PayNotifyLogic extends BaseLogic
|
|
|
* @notes 充值回调
|
|
|
* @param $orderSn
|
|
|
* @param array $extra
|
|
|
- * @author 段誉
|
|
|
- * @date 2023/2/27 15:28
|
|
|
*/
|
|
|
public static function recharge($orderSn, array $extra = [])
|
|
|
{
|
|
|
@@ -84,5 +84,26 @@ class PayNotifyLogic extends BaseLogic
|
|
|
$order->save();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @notes 服务回调
|
|
|
+ * @param $orderSn
|
|
|
+ * @param array $extra
|
|
|
+ */
|
|
|
+ public static function goods($orderSn, array $extra = [])
|
|
|
+ {
|
|
|
+ $order = RechargeOrder::where('sn', $orderSn)->findOrEmpty();
|
|
|
+ // 更新充值订单状态
|
|
|
+ $order->transaction_id = $extra['transaction_id'] ?? '';
|
|
|
+ $order->pay_status = PayEnum::ISPAID;
|
|
|
+ $order->pay_time = time();
|
|
|
+ $order->save();
|
|
|
+
|
|
|
+ $work = ServiceWork::findOrEmpty($order->work_id);
|
|
|
+ $work->work_pay_status = WorkEnum::IS_PAY_STATUS;
|
|
|
+ $work->work_total = $order->order_amount;
|
|
|
+ $work->work_amount = $order->order_amount;
|
|
|
+ $work->save();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|