|
@@ -6,6 +6,7 @@ use app\model\AccountModel;
|
|
|
use app\model\AddrModel;
|
|
|
use app\model\CommonModel;
|
|
|
use app\model\GoodModel;
|
|
|
+use app\model\MasterOrderModel;
|
|
|
use app\model\PayInfoModel;
|
|
|
use app\model\ServiceModel;
|
|
|
use think\facade\Db;
|
|
@@ -45,7 +46,7 @@ class PayLogic extends BaseLogic
|
|
|
'uid' => self::$aid,
|
|
|
'type' => $data['type'],
|
|
|
'ids' => json_encode($data['list']),
|
|
|
- 'status' => CommonModel::$order_status_wait_pay,
|
|
|
+ 'status' => MasterOrderModel::$order_status_wait_pay,
|
|
|
'createrid' => self::$aid,
|
|
|
'creater' => self::$aname,
|
|
|
'addtime' => $date,
|
|
@@ -82,7 +83,7 @@ class PayLogic extends BaseLogic
|
|
|
'addr_id' => $data['addr_id'],
|
|
|
'price' => $price,
|
|
|
'total_price' => $total_price,
|
|
|
- 'status' => CommonModel::$order_status_wait_pay,
|
|
|
+ 'status' => MasterOrderModel::$order_status_wait_pay,
|
|
|
'is_del' => CommonModel::$del_normal,
|
|
|
'createrid' => self::$aid,
|
|
|
'creater' => self::$aname,
|
|
@@ -124,8 +125,8 @@ class PayLogic extends BaseLogic
|
|
|
'price' => $item['price'],
|
|
|
'total_price' => $total_price,
|
|
|
'addr_id' => $data['addr_id'],
|
|
|
- 'type' => CommonModel::$pay_type_shopping_good,
|
|
|
- 'status' => CommonModel::$order_status_wait_pay,
|
|
|
+ 'type' => MasterOrderModel::$pay_type_shopping_good,
|
|
|
+ 'status' => MasterOrderModel::$order_status_wait_pay,
|
|
|
'is_del' => CommonModel::$del_normal,
|
|
|
'createrid' => self::$aid,
|
|
|
'creater' => self::$aname,
|
|
@@ -188,13 +189,13 @@ class PayLogic extends BaseLogic
|
|
|
if ($pay_info->isEmpty()) throw new Exception('该支付信息不存在');
|
|
|
|
|
|
//待处理
|
|
|
- if ($pay_info->status == CommonModel::$order_status_wait_pay) {
|
|
|
+ if ($pay_info->status == MasterOrderModel::$order_status_wait_pay) {
|
|
|
|
|
|
$updatetime = date('Y-m-d H:i:s');
|
|
|
|
|
|
- PayInfoModel::where(['pay_code' => $notifyInfo['out_trade_no'], 'status' => CommonModel::$order_status_wait_pay, 'id' => $pay_info->id])
|
|
|
+ PayInfoModel::where(['pay_code' => $notifyInfo['out_trade_no'], 'status' => MasterOrderModel::$order_status_wait_pay, 'id' => $pay_info->id])
|
|
|
->save([
|
|
|
- 'status' => CommonModel::$order_status_not_deliver,
|
|
|
+ 'status' => MasterOrderModel::$order_status_not_deliver,
|
|
|
'updaterid' => '0',
|
|
|
'updater' => '微信支付',
|
|
|
'updatetime' => $updatetime,
|
|
@@ -206,24 +207,24 @@ class PayLogic extends BaseLogic
|
|
|
if ($pay_info->type == GoodModel::$type_exchange) {
|
|
|
//兑换商品订单
|
|
|
Db::name('order')
|
|
|
- ->where(['is_del' => CommonModel::$del_normal, 'pay_info_id' => $pay_info->id, 'status' => CommonModel::$order_status_wait_pay])
|
|
|
+ ->where(['is_del' => CommonModel::$del_normal, 'pay_info_id' => $pay_info->id, 'status' => MasterOrderModel::$order_status_wait_pay])
|
|
|
->update([
|
|
|
'updaterid' => '0',
|
|
|
'updater' => '微信支付',
|
|
|
'updatetime' => $updatetime,
|
|
|
- 'status' => CommonModel::$order_status_not_deliver
|
|
|
+ 'status' => MasterOrderModel::$order_status_not_deliver
|
|
|
]);
|
|
|
|
|
|
|
|
|
} else {
|
|
|
//服务订单
|
|
|
Db::name('order_service')
|
|
|
- ->where(['is_del' => CommonModel::$del_normal, 'pay_info_id' => $pay_info->id, 'status' => CommonModel::$order_status_wait_pay])
|
|
|
+ ->where(['is_del' => CommonModel::$del_normal, 'pay_info_id' => $pay_info->id, 'status' => MasterOrderModel::$order_status_wait_pay])
|
|
|
->update([
|
|
|
'updaterid' => '0',
|
|
|
'updater' => '微信支付',
|
|
|
'updatetime' => $updatetime,
|
|
|
- 'status' => CommonModel::$order_status_not_deliver
|
|
|
+ 'status' => MasterOrderModel::$order_status_not_deliver
|
|
|
]);
|
|
|
}
|
|
|
|
|
@@ -253,7 +254,7 @@ class PayLogic extends BaseLogic
|
|
|
->findOrEmpty()
|
|
|
->toArray();
|
|
|
if (empty($rs)) return json_show(CommonModel::$error_param, '该支付信息不存在');
|
|
|
- if ($rs['status'] == CommonModel::$order_status_wait_pay) {
|
|
|
+ if ($rs['status'] == MasterOrderModel::$order_status_wait_pay) {
|
|
|
//待支付时,手动去微信端查验是否支付完成(有可能异步通知到的晚,尚未更新状态)
|
|
|
$temp = WechatLogic::checkPayResult($pay_code);
|
|
|
$rs['status'] = $temp['RESULT_CODE'];//????@todo
|