diff --git a/application/api/model/GiveGift.php b/application/api/model/GiveGift.php index 8fd36e4..3da2548 100644 --- a/application/api/model/GiveGift.php +++ b/application/api/model/GiveGift.php @@ -128,7 +128,7 @@ class GiveGift extends Model $gift_total = 0; $give_gift = 0; $gift_user_data = []; - foreach ($toarray as $to_id){ + foreach ($toarray as $k => $to_id){ $gift_user_data[]['user_id'] = $to_id; $gift_box1 = []; $gift_box = []; @@ -176,7 +176,7 @@ class GiveGift extends Model return ['code' => 0, 'msg' => '送礼失败', 'data' => null]; } } - $gift_user_data[]['gift_price'] = $gift_price; + $gift_user_data[$k]['gift_price'] = $gift_price; //计算收礼人得益 $receiver_earnings = $this -> receiver_earnings($to_id,$gift_price,$from_type);