delete(); if (count($data) <= 0) return true; foreach ($data as $k => &$time) { $time['event_id'] = $id; if ($time['event_number'] >= $number) continue; self::set($time); } return true; } /** *获取 活动人数及对应价格列表 */ public static function eventPriceList($id = 0) { $list = self::where(['event_id' => $id])->order('sort ASC')->select(); return count($list) > 0 ? $list->toArray() : []; } /**删除 活动人数及对应价格列表 * @param $event_id */ public static function delEventPrice($event_id) { return self::where('event_id', $event_id)->delete(); } }