/** * 删除回复 */ public function del_replyOp() { // 验证回复 $this->checkReplySelf(); $model = Model(); // 删除商品 $goods_list = $model->table('circle_thg')->where(array('theme_id' => $this->t_id, 'reply_id' => $this->r_id))->delete(); // 删除附件 $where = array(); $where['affix_type'] = 2; $where['member_id'] = $_SESSION['member_id']; $where['theme_id'] = $this->t_id; $where['reply_id'] = $this->r_id; $affix_list = $model->table('circle_affix')->where($where)->select(); if ($affix_list) { foreach ($affix_list as $val) { @unlink(themeImagePath($val['affix_filename'])); @unlink(themeImagePath($val['affix_filethumb'])); } $model->table('circle_affix')->where($where)->delete(); } // The recycle bin add delete records $param = array(); $param['theme_id'] = $this->t_id; $param['reply_id'] = $this->r_id; $param['op_id'] = $_SESSION['member_id']; $param['op_name'] = $_SESSION['member_name']; $param['type'] = 'reply'; Model('circle_recycle')->saveRecycle($param); // 删除回复 $model->table('circle_threply')->where(array('theme_id' => $this->t_id, 'reply_id' => $this->r_id, 'member_id' => $_SESSION['member_id']))->delete(); // Experience if (intval($this->reply_info['reply_exp']) > 0) { $param = array(); $param['member_id'] = $_SESSION['member_id']; $param['member_name'] = $_SESSION['member_name']; $param['circle_id'] = $this->c_id; $param['itemid'] = $this->t_id . ',' . $this->r_id; $param['type'] = 'delReplied'; $param['exp'] = $this->reply_info['reply_exp']; Model('circle_exp')->saveExp($param); } showDialog(L('nc_common_op_succ'), 'reload', 'succ'); }
/** * 删除回复 */ public function del_replyOp() { // 身份验证 $rs = $this->checkIdentity('cm'); if (!empty($rs)) { showMessage($rs); } $t_id = intval($_GET['t_id']); $r_id = intval($_GET['r_id']); // 验证回复 $model = Model(); $where = array(); $where['theme_id'] = $t_id; $where['reply_id'] = $r_id; $where['circle_id'] = $this->c_id; $reply_info = $model->table('circle_threply')->where($where)->find(); if (empty($reply_info)) { showDialog(L('circle_reply_not_exists'), 'reload'); } // 删除附件 $affix_list = $model->table('circle_affix')->where(array('affix_type' => 2, 'theme_id' => $t_id, 'reply_id' => $r_id))->select(); if (!empty($affix_list)) { foreach ($affix_list as $val) { @unlink(themeImagePath($val['affix_filename'])); @unlink(themeImagePath($val['affix_filethumb'])); } $model->table('circle_affix')->where(array('affix_type' => 2, 'theme_id' => $t_id, 'reply_id' => $r_id))->delete(); } // 删除商品 $model->table('circle_thg')->where(array('theme_id' => $t_id, 'reply_id' => $r_id))->delete(); // The recycle bin add delete records $param = array(); $param['theme_id'] = $t_id; $param['reply_id'] = $r_id; $param['op_id'] = $_SESSION['member_id']; $param['op_name'] = $_SESSION['member_name']; $param['type'] = 'reply'; Model('circle_recycle')->saveRecycle($param); // 删除回复 $rs = $model->table('circle_threply')->where(array('theme_id' => $t_id, 'reply_id' => $r_id))->delete(); // 更新话题回复数 $model->table('circle_theme')->update(array('theme_id' => $t_id, 'theme_commentcount' => array('exp', 'theme_commentcount-1'))); // Experience if (intval($reply_info['reply_exp']) > 0) { $param = array(); $param['member_id'] = $reply_info['member_id']; $param['member_name'] = $reply_info['member_name']; $param['circle_id'] = $this->c_id; $param['itemid'] = $t_id . ',' . $r_id; $param['type'] = 'delReplied'; $param['exp'] = $reply_info['reply_exp']; Model('circle_exp')->saveExp($param); } showDialog(L('nc_common_op_succ'), 'reload', 'succ'); }
/** * 话题回复删除 */ public function theme_replydelOp() { $t_id = intval($_GET['t_id']); $r_id = intval($_GET['r_id']); $model = Model(); // 验证回复 $reply_info = $model->table('circle_threply')->where(array('theme_id' => $t_id, 'reply_id' => $r_id))->find(); if (empty($reply_info)) { showMessage(L('param_error')); } // 删除附件 $affix_list = $model->table('circle_affix')->where(array('affix_type' => 2, 'theme_id' => $t_id, 'reply_id' => $r_id))->select(); if (!empty($affix_list)) { foreach ($affix_list as $val) { @unlink(themeImagePath($val['affix_filename'])); @unlink(themeImagePath($val['affix_filethumb'])); } $model->table('circle_affix')->where(array('affix_type' => 2, 'theme_id' => $t_id, 'reply_id' => $r_id))->delete(); } // 删除商品 $model->table('circle_thg')->where(array('theme_id' => $t_id, 'reply_id' => $r_id))->delete(); // The recycle bin add delete records $param = array(); $param['theme_id'] = $t_id; $param['reply_id'] = $r_id; $param['op_id'] = 0; $param['op_name'] = L('cirlce_administrator'); $param['type'] = 'adminreply'; Model('circle_recycle')->saveRecycle($param, $reply_info); // 删除回复 $model->table('circle_threply')->where(array('theme_id' => $t_id, 'reply_id' => $r_id))->delete(); // 更新话题回复数 $model->table('circle_theme')->update(array('theme_id' => $t_id, 'theme_commentcount' => array('exp', 'theme_commentcount-1'))); // Experience if (intval($reply_info['reply_exp']) > 0) { $param = array(); $param['member_id'] = $reply_info['member_id']; $param['member_name'] = $reply_info['member_name']; $param['circle_id'] = $reply_info['circle_id']; $param['itemid'] = $t_id . ',' . $r_id; $param['type'] = 'delReplied'; $param['exp'] = $reply_info['reply_exp']; Model('circle_exp')->saveExp($param); } showMessage(L('nc_common_op_succ')); }
/** * 删除圈子 */ public function circle_delOp() { $id = intval($_GET['c_id']); if ($id <= 0) { showMessage(L('param_error')); } $model = Model(); $circle_info = $model->table('circle')->find($id); if (!empty($circle_info)) { @unlink(BASE_UPLOAD_PATH . DS . ATTACH_CIRCLE . '/group/' . $circle_info['circle_id'] . '.jpg'); } // 删除附件 $affix_list = $model->table('circle_affix')->where(array('circle_id' => $id))->select(); if (!empty($affix_list)) { foreach ($affix_list as $val) { @unlink(themeImagePath($val['affix_filename'])); @unlink(themeImagePath($val['affix_filethumb'])); } $model->table('circle_affix')->where(array('circle_id' => $id))->delete(); } // 删除商品 $model->table('circle_thg')->where(array('circle_id' => $id))->delete(); // 删除赞表相关 $model->table('circle_like')->where(array('circle_id' => $id))->delete(); // 删除回复 $model->table('circle_threply')->where(array('circle_id' => $id))->delete(); // 删除话题 $model->table('circle_theme')->where(array('circle_id' => $id))->delete(); // 删除成员 $model->table('circle_member')->where(array('circle_id' => $id))->delete(); // 删除圈子 $model->table('circle')->delete($id); $this->log(L('nc_del_circle') . '[' . $id . ']'); showMessage(L('nc_common_op_succ')); }