...
|
...
|
@@ -63,15 +63,29 @@ class SomepayController extends HomeBaseController |
|
|
//验签
|
|
|
if ($base->CheckSign($config)) {
|
|
|
if ($data["return_code"] == "SUCCESS") {
|
|
|
$a['a'] ='99';
|
|
|
$a['c'] = json_decode($data);
|
|
|
Db::name('Test')->insertGetId($a);
|
|
|
// 支付成功
|
|
|
// Db::startTrans();
|
|
|
Db::startTrans();
|
|
|
//// 更新主表状态
|
|
|
// $where_orderN['order_sn'] = $data['out_trade_no'];
|
|
|
// $where_orderN['status'] = 2;
|
|
|
// $order = Db::name('Order')->where($where_orderN)->find();
|
|
|
|
|
|
$where_orderN['order_sn'] = $data['out_trade_no'];
|
|
|
$where_orderN['status'] = 3;
|
|
|
$where_orderN['pay_time'] = time();
|
|
|
$order = Db::name('Order')->where($where_orderN)->find();
|
|
|
if($order){
|
|
|
$up_order['status'] = 10;
|
|
|
$up_order['update_time'] = time();
|
|
|
$up_order['trans_id'] = $data['transaction_id'];
|
|
|
$res_order = Db::name('Order')->where($where_orderN)->update($up_order);
|
|
|
if($res_order){
|
|
|
Db::commit();
|
|
|
return true;
|
|
|
}else{
|
|
|
Db::rollback();
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
...
|
...
|
|