tablePrefix ='tab_'; /* 执行构造方法 */ parent::__construct($name, $tablePrefix, $connection); } public function paySubmit($orderId) { if (!$orderId) return 0; $log = $this->where(array( 'pay_order_number' => $orderId ))->order('id desc')->find(); if (!$log) return 0; $this->where(array( 'id' => $log['id'] ))->save(array( 'is_submit' => 1 )); } // 支付成功 public function updatePaySuccess($orderId) { $this->where(array( 'pay_order_number' => $orderId, 'pay_status' => 0 ))->save(array( 'pay_status' => 1 )); } // 通知游戏成功 public function updateGameNotifySuccess($orderId) { $this->where(array( 'pay_order_number' => $orderId, 'pay_game_status' => 0 ))->save(array( 'pay_game_status' => 1 )); } }