| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace bizHd\ljh\classes;
- use bizHd\base\classes\BaseClass;
- use common\components\util;
- use Yii;
- class LjhApplyClass extends BaseClass
- {
- public static $baseFile = '\bizHd\ljh\models\LjhApply';
- public static function addBase($data, $bool)
- {
- return self::add($data, $bool);
- }
- public static function addApply($data)
- {
- $respond = self::addBase($data, true);
- return $respond;
- }
- //微信第三方支付
- public static function thirdPay($payWay, $orderSn, $totalFee, $attach, $transactionId)
- {
- $info = self::getByCondition(['orderSn' => $orderSn], true);
- if (empty($info)) {
- $msg = "没有找到订单 orderSn:{$orderSn}";
- Yii::info($msg);
- util::fail($msg);
- }
- if ($info->actPrice != $totalFee) {
- $msg = "订单金额与回调通知金额不一致 orderSn:{$orderSn} {$info->actPrice} {$totalFee}";
- Yii::info($msg);
- util::fail($msg);
- }
- $id = $info->id;
- $info = self::getLockById($id);
- $info->thirdNo = $transactionId;
- $info->status = 2;
- $info->payWay = $payWay;
- $info->payTime = date("Y-m-d H:i:s");
- $info->save();
- }
- }
|