diff --git a/webapp/classes/AddReward.php b/webapp/classes/AddReward.php index a66828f..0238c18 100644 --- a/webapp/classes/AddReward.php +++ b/webapp/classes/AddReward.php @@ -170,6 +170,7 @@ class AddReward { } $status = 2; $active_time = $time * 3600 + time(); + error_log($active_time); if ($time == 0) { $active_time = 0; $status = 1; diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index c7ace60..cd80c59 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -106,6 +106,28 @@ class BagController{ 'color_id' => $color_id, )); } + } else { + $ret = $conn->execScript('INSERT INTO bag(accountid, id, color_id, status, active_time, create_time, modify_time) ' . + ' VALUES(:account_id, :id, 0, :status, :active_time, :create_time, :modify_time) ' . + ' ON DUPLICATE KEY UPDATE accountid=:account_id, id=:id, color_id=0, status=:status, active_time=:active_time, modify_time=:modify_time;', + array( + ':account_id' => $account_id, + ':id' => 16001, + ':active_time' => 0, + ':status' => 1, + ':create_time' => time(), + ':modify_time' => time() + )); + if(!$ret){ + die(); + return; + } + array_push($bag_list, array( + 'id' => 16001, + 'active_time' => 0, + 'status' => 1, + 'color_id' => 0, + )); } echo json_encode(array( 'errcode' => 0,