$v){ $query = []; $queryPrize = []; $query['open_mode'] = 'km'; $query['activity_id'] = $queryPrize['activity_id'] = $activity_id; $query['corp_id'] = $queryPrize['corp_id'] = $corp_id; $query['lottery_level'] = $queryPrize['lottery_level'] = $v; $query['create_time'] = $query['update_time'] = $queryPrize['update_time'] = $queryPrize['create_time'] = time(); switch($v){ case 1: $query['open_rule'] = 100; $query['status'] = 1; $query['lottery_name'] = '铜宝箱'; $query['lottery_icon'] = '//s1-hn.aghcdn.com/brainstorming/prize/prize_one.png'; //示例铜宝箱奖品 $queryPrize['prize_name'] = '铜质奖章'; $queryPrize['prize_day_rule'] = 10; $queryPrize['prize_count'] = 10; $queryPrize['prize_weights'] = 1000; $queryPrize['prize_image_url'] = '//s1-hn.aghcdn.com/management/20181025/b4b94f2a3a2c6b6b32cf8a8e6a3178f9c6b036e5.png'; //参数组装 $querys[] = $query; $queryPrizes[] = $queryPrize; break; case 2: $query['open_rule'] = 200; $query['status'] = 1; $query['lottery_name'] = '银宝箱'; $query['lottery_icon'] = '//s1-hn.aghcdn.com/brainstorming/prize/prize_two.png'; //示例银宝箱奖品 $queryPrize['prize_name'] = '银质奖章'; $queryPrize['prize_day_rule'] = 20; $queryPrize['prize_count'] = 20; $queryPrize['prize_weights'] = 800; $queryPrize['prize_image_url'] = '//s1-hn.aghcdn.com/management/20181025/b0bb22a2d9f68fd484154e867fc7ac50eb7b0c49.png'; //参数组装 $querys[] = $query; $queryPrizes[] = $queryPrize; break; case 3: $query['open_rule'] = 500; $query['status'] = 1; $query['lottery_name'] = '金宝箱'; $query['lottery_icon'] = '//s1-hn.aghcdn.com/brainstorming/prize/prize_three.png'; //示例金宝箱奖品 $queryPrize['prize_name'] = '金质奖章'; $queryPrize['prize_day_rule'] = 30; $queryPrize['prize_count'] = 30; $queryPrize['prize_weights'] = 500; $queryPrize['prize_image_url'] = '//s1-hn.aghcdn.com/management/20181025/85be5acc8c0dcab4d572a78d7281674ff316e86a.png'; //参数组装 $querys[] = $query; $queryPrizes[] = $queryPrize; break; case 4: $query['lottery_level'] = 4; $query['open_rule'] = 0; $query['status'] = 0; $query['lottery_name'] = '幸运宝箱'; $query['lottery_icon'] = '//s1-hn.aghcdn.com/brainstorming/prize/prize_four.png'; //参数组装(幸运宝箱无示例奖品) $querys[] = $query; break; } } $res = LotteryBoxs::insert($querys); $res_prize = Prizes::insert($queryPrizes); if($res && $res_prize){ return true; } else { return false; } } }