...
|
...
|
@@ -67,49 +67,30 @@ class SomepayController extends HomeBaseController |
|
|
//// 更新主表状态
|
|
|
$where_orderN['order_sn'] = $data['out_trade_no'];
|
|
|
$where_orderN['status'] = 3;
|
|
|
$a['a'] ='22';
|
|
|
$a['f'] = json_encode($where_orderN);
|
|
|
Db::name('Test')->insertGetId($a);
|
|
|
$order = Db::name('Order')->where($where_orderN)->find();
|
|
|
$a['a'] ='33';
|
|
|
$a['f'] = json_encode($order);
|
|
|
Db::name('Test')->insertGetId($a);
|
|
|
if($order){
|
|
|
$up_order['status'] = 10;
|
|
|
$up_order['update_time'] = time();
|
|
|
$up_order['pay_time'] = time();
|
|
|
$up_order['trans_id'] = $data['transaction_id'];
|
|
|
$a['a'] ='44';
|
|
|
$a['f'] = json_encode($up_order);
|
|
|
Db::name('Test')->insertGetId($a);
|
|
|
$res_order = Db::name('Order')->where($where_orderN)->update($up_order);
|
|
|
$a['a'] ='55';
|
|
|
$a['g'] = json_encode($res_order);
|
|
|
Db::name('Test')->insertGetId($a);
|
|
|
|
|
|
if($res_order){
|
|
|
// 更新雇人表
|
|
|
$where_hire['id'] = $order['hire_id'];
|
|
|
$where_hire['status'] = 3;
|
|
|
$up_hire['status'] = 10;
|
|
|
$up_hire['update_time'] = time();
|
|
|
|
|
|
|
|
|
$a['a'] ='66';
|
|
|
$a['g'] = json_encode($where_hire);
|
|
|
Db::name('Test')->insertGetId($a);
|
|
|
$res_hire = Db::name('Hire')->where($where_hire)->update($up_hire);
|
|
|
$a['a'] ='77';
|
|
|
$a['g'] = json_encode($res_hire);
|
|
|
Db::name('Test')->insertGetId($a);
|
|
|
if($res_hire){
|
|
|
// Db::commit();
|
|
|
Db::commit();
|
|
|
return true;
|
|
|
}else{
|
|
|
// Db::rollback();
|
|
|
Db::rollback();
|
|
|
return false;
|
|
|
}
|
|
|
}else{
|
|
|
// Db::rollback();
|
|
|
Db::rollback();
|
|
|
return false;
|
|
|
}
|
|
|
}
|
...
|
...
|
|