From e155b87724416bc27ddc3f64d24d4a073a7cb5e1 Mon Sep 17 00:00:00 2001 From: wangwei01 Date: Tue, 16 Jul 2019 15:08:24 +0800 Subject: [PATCH] 1 --- webapp/controller/ShareController.class.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/webapp/controller/ShareController.class.php b/webapp/controller/ShareController.class.php index ce917db..f0d9447 100644 --- a/webapp/controller/ShareController.class.php +++ b/webapp/controller/ShareController.class.php @@ -245,12 +245,17 @@ class ShareController{ if (count($rows) == 0) { $share_meta_table = require('../res/share@share.php'); for ($i = 1; $i <= count($share_meta_table); $i++) { + $id = $i; + $share_meta = getShareConfig($share_meta_table, $id); + if ($share_meta == NULL) { + $id = -10000; + } $ret = $conn->execScript('INSERT INTO share_achievement(accountid, ach_id, status, create_time, modify_time) ' . ' VALUES(:account_id, :ach_id, :status, :create_time, :modify_time) ' . ' ON DUPLICATE KEY UPDATE accountid=:account_id, ach_id=:ach_id, status=:status, modify_time=:modify_time;', array( ':account_id' => $account_id, - ':ach_id' => $i, + ':ach_id' => $id, ':status' => 0, ':create_time' => time(), ':modify_time' => time() @@ -259,9 +264,13 @@ class ShareController{ die(); return; } + $sh = $this->getShare($id); + $array = $this->getExplode($sh['rewards']); array_push($info_list, array( - 'achivement_id' => $i, - 'status' => 0 + 'achivement_id' => $id, + 'status' => 0, + 'item_id' => $array[0][0], + 'num' => $array[0][1], )); } } else {