=', $time_add_from); } if ($time_add_to) { $condition[] = array('instant_message_add_time', '>=', $time_add_to); } $instant_message_open = input('param.instant_message_open'); if (in_array($instant_message_open, array('0', '1', '2'))) { $condition[] = array('instant_message_open', '=', $instant_message_open); } $instant_message_list = $instant_message_model->getInstantMessageList($condition, 10); foreach ($instant_message_list as $key => $val) { $instant_message_list[$key] = $instant_message_model->formatInstantMessage($val); } View::assign('instant_message_list', $instant_message_list); View::assign('show_page', $instant_message_model->page_info->render()); View::assign('search', $condition); $this->setAdminCurItem('index'); return View::fetch(); } /** * 删除商品 */ public function del() { $instant_message_id = input('param.instant_message_id'); $instant_message_id_array = ds_delete_param($instant_message_id); if ($instant_message_id_array == FALSE) { ds_json_encode('10001', lang('ds_common_op_fail')); } $condition = array(); $condition[] = array('instant_message_id', 'in', $instant_message_id_array); model('instant_message')->delInstantMessage($condition); $this->log(lang('ds_del') . lang('instant_message') . ' ID:' . implode('、', $instant_message_id_array), 1); ds_json_encode('10000', lang('ds_common_op_succ')); } /* * 直播设置 */ public function setting() { $config_model = model('config'); if (!request()->isPost()) { $list_config = rkcache('config', true); View::assign('list_config', $list_config); $this->setAdminCurItem('setting'); return View::fetch(); } else { $update_array = array(); $update_array['instant_message_gateway_url'] = input('param.instant_message_gateway_url'); $update_array['instant_message_register_url'] = input('param.instant_message_register_url'); $update_array['instant_message_open'] = input('param.instant_message_open'); $result = $config_model->editConfig($update_array); if ($result) { dkcache('config'); $this->log(lang('ds_setting') . lang('instant_message'), 1); $this->success(lang('ds_common_save_succ')); } else { $this->log(lang('ds_setting') . lang('instant_message'), 0); } } } /** * 获取卖家栏目列表,针对控制器下的栏目 */ protected function getAdminItemList() { $menu_array = array( array( 'name' => 'index', 'text' => lang('ds_list'), 'url' => url('InstantMessage/index') ), array( 'name' => 'setting', 'text' => lang('ds_setting'), 'url' => url('InstantMessage/setting') ), ); return $menu_array; } }