| xqd
@@ -152,7 +152,7 @@ class PayController extends Controller
|
|
|
\Log::info('支付成功');
|
|
|
|
|
|
$out_trade_no = $rawInfo['out_trade_no'];
|
|
|
- $order = Order::where('transaction_id', '=', $out_trade_no)->first();
|
|
|
+ $order = OrderInfoModel::where('transaction_id', '=', $out_trade_no)->first();
|
|
|
if (!$order) {
|
|
|
\Log::error('找不到订单' . $out_trade_no);
|
|
|
return 'fail';
|
| xqd
@@ -169,10 +169,10 @@ class PayController extends Controller
|
|
|
}
|
|
|
$tp = '';
|
|
|
// $u = null;
|
|
|
- if ($order->user_type == Order::USER_TYPE_MERCHANT) {
|
|
|
+ if ($order->user_type == OrderInfoModel::USER_TYPE_MERCHANT) {
|
|
|
$tp = 'Merchant';
|
|
|
// $u = Merchant::find($order->user_id);
|
|
|
- } elseif ($order->user_type == Order::USER_TYPE_MEMBER) {
|
|
|
+ } elseif ($order->user_type == OrderInfoModel::USER_TYPE_MEMBER) {
|
|
|
$tp = 'Member';
|
|
|
//Not handled here
|
|
|
}
|
| xqd
@@ -184,11 +184,11 @@ class PayController extends Controller
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
|
|
- if ($order->goods_type == Order::GOODS_TYPE_BALANCE||$order->goods_type == Order::GOODS_TYPE_COSUME) {
|
|
|
+ if ($order->goods_type == OrderInfoModel::GOODS_TYPE_BALANCE||$order->goods_type == OrderInfoModel::GOODS_TYPE_COSUME) {
|
|
|
$cType = AccountLog::TYPE_BALANCE;
|
|
|
// $u->account_balance += $order->number;
|
|
|
$u->balance += $master_amount;
|
|
|
- } elseif ($order->goods_type == Order::GOODS_TYPE_CREDIT) {
|
|
|
+ } elseif ($order->goods_type == OrderInfoModel::GOODS_TYPE_CREDIT) {
|
|
|
$cType = AccountLog::TYPE_CREDIT;
|
|
|
// $u->credit_balance += $order->number;
|
|
|
$u->credit += $master_amount;
|
| xqd
@@ -201,7 +201,7 @@ class PayController extends Controller
|
|
|
if ($u->save()) {
|
|
|
|
|
|
//更新订单状态
|
|
|
- $order->status = Order::STATUS_FINISHED;
|
|
|
+ $order->status = OrderInfoModel::STATUS_FINISHED;
|
|
|
$order->save();
|
|
|
|
|
|
//记日志
|