From 8f019f596489dc5b777bd1406313668f208c15c9 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Tue, 20 Sep 2022 10:23:16 +0800 Subject: [PATCH] 1 --- webapp/models/Chip.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webapp/models/Chip.php b/webapp/models/Chip.php index bc5ebfb4..b10e4af6 100644 --- a/webapp/models/Chip.php +++ b/webapp/models/Chip.php @@ -106,7 +106,12 @@ class Chip extends BaseModel $heroDb = $hero; } }); - return $heroDb['hero_id']; + if($heroDb){ + return $heroDb['hero_id']; + }else{ + return 0; + } + } if ($row['chip_type'] == 2){ $gunDb = array(); @@ -115,7 +120,11 @@ class Chip extends BaseModel $gunDb = $gun; } }); - return $gunDb['gun_id']; + if($gunDb){ + return $gunDb['gun_id']; + }else{ + return 0; + } } }