| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace bizHd\px\services;
- use bizHd\base\services\BaseService;
- use bizHd\px\classes\PxApplyClass;
- use common\components\dict;
- use common\components\util;
- use Yii;
- class PxApplyService extends BaseService
- {
- public static $baseFile = '\bizHd\px\classes\PxApplyClass';
- //新增报名成功 ssh 2021.3.17
- public static function addBmPx($data)
- {
- $order = PxApplyClass::addApply($data, true);
- $payWay = dict::getDict('payWay', 'unknown');
- PxApplyClass::complete($order, $payWay);
- return $order;
- }
- //培训报名 ssh 20210523
- public static function thirdPay($payWay, $orderSn, $totalFee, $attach)
- {
- $order = PxApplyClass::getByCondition(['orderSn' => $orderSn], true);
- if (empty($order)) {
- $msg = "没有找到报名订单 orderSn:{$orderSn}";
- Yii::info($msg);
- util::fail($msg);
- }
- if ($order->actPrice != $totalFee) {
- $msg = "报名订单金额与回调通知金额不一致 orderSn:{$orderSn} {$order->actPrice} {$totalFee}";
- Yii::info($msg);
- util::fail($msg);
- }
- //临时解决微信一秒内通知二次问题
- $id = $order->id;
- $order = PxApplyClass::getLockById($id);
- PxApplyClass::complete($order, $payWay);
- }
- }
|