first(); } /** * 获取所有客服消息开关 */ static function getCustomMsgSwitchs() { return self::where(['status'=>1])->select('custom_category','id','title')->orderBy('id','asc')->get(); } /** * 获取所有客服消息开关 */ static function customMsgSwitchs() { return self::select()->get(); } /** * 获取类型为键名的所有客服消息开关 */ static function getCustomMsgSwitchByCategorys() { $result = array(); $custom_msg_switchs = self::select()->get()->toArray(); foreach($custom_msg_switchs as $key=> $custom_msg_switch){ $result[$custom_msg_switch['custom_category']] = $custom_msg_switch; } return $result; } }