/** * 添加、修改数据库数据 * @author 李东 * @date 2015-06-16 */ public function update() { if (IS_POST) { if ($_POST['type'] == 'image' && $_POST['old_image'] == '' && I('post.image') == "") { $this->error("图片不能为空!"); } if ($_POST['type'] == 'code' && I('post.content') == "") { $this->error("HTML代码不能为空!"); } $rules = array(); $_POST['page'] = $this->cache_name; $result = update_data($this->table, $rules); if (is_numeric($result)) { if (I('post.image') != '') { unlink($_POST['old_image']); } multi_file_upload(I('post.image'), 'Uploads/Banner', 'banner', 'id', $result, 'image'); F($this->cache_name, null); $this->success('操作成功!', U('index')); } else { $this->error($result); } } else { $this->success('违法操作', U('index')); } }
protected function update() { $id = intval(I("id")); $rules = array(array('category_id', 'require', '分类必须!', 1), array('title', 'require', '标题必须!', 1), array('content', 'require', '内容必须!', 1)); $category_id = I('category_id'); //当数据为修改时再查询修改前的分类ID if ($id != 0) { $info = get_info($this->table, array('id' => $id), 'category_id,path'); } $category_info = get_info("category", array("id" => $category_id), 'path'); $_POST['path'] = $category_info['path'] . $category_id . '-'; //替换内容中的本地图片路径 $_POST['content'] = replaceStrImg($_POST['content'], "replace"); $_POST['type'] = 'news'; $result = update_data($this->table, $rules); if (is_numeric($result)) { if (I('post.cover') != '') { unlink($_POST['old_cover']); multi_file_upload(I('post.cover'), 'Uploads/News', 'article', 'id', $result, 'cover'); } //统计分类(包括父级分类,修改后的)下的内容数量并保存到分类表 //通过path获取到父级分类id $path = explode('-', $_POST['path']); foreach ($path as $key => $val) { $_POST = null; if ($val != 0) { $_POST['id'] = $val; $_POST['num'] = count_data($this->table, array("path" => array("like", '%-' . $val . '-%'))); update_data("category"); } } if ($info['category_id'] != $category_id) { if ($id > 0) { //统计分类(包括父级分类,修改前的)下的内容数量并保存到分类表 //通过path获取到父级分类id $info_path = explode('-', $info['path']); foreach ($info_path as $key => $val) { $_POST = null; if ($val != 0) { $_POST['id'] = $val; $_POST['num'] = count_data($this->table, array("path" => array("like", '%-' . $val . '-%'))); update_data("category"); } } } } if ($id == 0) { F('news_category_result', null); } $this->success('操作成功!', U('index', array('type' => $type))); } else { $this->error($result); } }
public function index() { if (IS_POST) { $posts = I("post."); /* *调整form_name的顺序,将form_name为editor的顺序调到最后 *因为表单提交过来的数据会自动把编辑器的值放到后面 */ foreach ($posts['form_name'] as $val) { if ($val != "editor") { $fromname[] = $val; } else { $editor_arr[] = $val; } } unset($posts['form_name']); if ($editor_arr) { $form_name = array_merge($fromname, $editor_arr); } else { $form_name = $fromname; } $num = 0; foreach ($posts as $key => $val) { $_POST = null; if (is_array($val)) { $value = ''; foreach ($val as $k => $v) { $value .= $v . ','; } $value = rtrim($value, ','); } else { $value = $val; } if ($form_name[$num] == "image") { multi_file_upload($value, 'Uploads/System/Image', 'config', 'id', $key, 'value'); } else { $_POST["id"] = $key; $_POST["value"] = $value; update_data($this->table); } $num++; } F('config', null); $this->success("设置成功"); } else { $map['status'] = 1; /*查询未被删除的项*/ $data['_result'] = M($this->table)->where($map)->select(); $this->assign($data); $this->display(); } }
protected function operate() { $cover = $_POST['new_cover']; unset($_POST['new_cover']); $pid = I('pid'); $_POST['uid'] = session("member_id"); $rules = array(array('title', 'require', '请输入分类名称!', 1)); $result = update_data($this->table, $rules); if (is_numeric($result)) { if ($cover) { multi_file_upload($cover, 'Uploads/Images', 'category', 'id', $result, 'cover'); } F($this->cache_data, null); $this->success('操作成功', U('index', array('pid' => $pid))); } else { $this->error($result); } }
public function update() { if (IS_POST) { $id = intval(I('post.id')); $rules = array(array('username', 'require', '用户名必须填写!')); $_POST['is_admin'] = 0; if ($id == 0) { //如果是添加 $rules[] = array('password', 'require', '密码必须填写!'); $_POST['password'] = md5(md5(I('post.password'))); } else { //如果是修改 if (I('post.password')) { $_POST['password'] = md5(md5(I('post.password'))); } else { unset($_POST['password']); } } $result = update_data($this->table, $rules); if (is_numeric($result)) { /*将店铺logo更新到数据库*/ F($this->cache_name, null); /*将皮肤缩略图更新到数据库*/ multi_file_upload(I('thumb'), 'Uploads/Shop', 'theme', 'id', $result, 'thumb'); $this->success('操作成功', U('index')); } else { $this->error($result); } } else { $this->success('违法操作', U('index')); } }
/** * 店铺评论添加 * 1.验证用户评论信息是否都填写完整,不完整给出提示, * 2.验证用户评论的订单是否处于可评论状态,不可评论给出提示, * 3.验证用户是否已经评论过,已经评论过给出提示, * * 开启事务 * 4.将评论信息以及计算出的综合评分记录到评论表 * 5.点星级信息以及评价总数更新到店铺信息表 * 6.将订单评论状态改为已评论 * 7.将订单历史记录表数据更新 * 4、5、6、7都成功,提交事务,否则回滚事务 * */ public function comment() { if (IS_POST) { $posts = I('post.'); $product_id = $posts['product_id']; $order_id = $posts['order_id']; $member_id = session('home_member_id'); $type = $posts['type']; if (!in_array(intval($type), array(1, 2, 3))) { $tips_msg = array('status' => '0', 'msg' => '请选择给该店铺好/中/差评'); goto export; } if (!$posts['speed_star_num']) { $tips_msg = array('status' => '0', 'msg' => '请为本次服务速度打分'); goto export; } if (!$posts['quality_star_num']) { $tips_msg = array('status' => '0', 'msg' => '请为本次服务质量打分'); goto export; } if (!$posts['serve_star_num']) { $tips_msg = array('status' => '0', 'msg' => '请为本次服务打分'); goto export; } if (!$posts['content']) { $tips_msg = array('status' => '0', 'msg' => '请填写评价内容'); goto export; } $map['id'] = $order_id; $map['status'] = 3; $order_info = get_info($this->table, $map); if (!$order_info) { /*判断订单是否是存在*/ $tips_msg = array('status' => '0', 'msg' => '订单不存在或不能评论', 'url' => U('index')); goto export; } if ($member_id != $order_info['member_id']) { /*判断用户评论的是否是自己的订单*/ $tips_msg = array('status' => '0', 'msg' => '只能评论自己的订单', 'url' => U('index')); goto export; } if ($order_info['is_comment'] > 0) { /*判断是否已经评论过*/ $tips_msg = array('status' => '0', 'msg' => '订单已经评论过', 'url' => U('index')); goto export; } /*计算单条评价综合评分*/ $star_num = round(($posts['speed_star_num'] + $posts['quality_star_num'] + $posts['serve_star_num']) / 3, 1); /*开启事务*/ $Model = M(); $Model->startTrans(); $posts['content'] = get_word_search($posts['content']); $_POST = array('order_id' => $order_id, 'product_id' => $order_info['product_id'], 'shop_id' => $order_info['shop_id'], 'content' => $posts['content'], 'member_id' => $member_id, 'type' => $type, 'speed_star_num' => $posts['speed_star_num'], 'quality_star_num' => $posts['quality_star_num'], 'serve_star_num' => $posts['serve_star_num'], 'star_num' => $star_num); $res = update_data($this->comment); /*店铺表评论数增加1,统计平均星级并更新*/ $map = null; $map['id'] = $order_info['shop_id']; $shop_info = get_info($this->shop_table, $map); $comment_num = $shop_info['comment_num'] + 1; /*计算平均速度星级*/ $speed_star_num = ($shop_info['speed_star_num'] * $shop_info['comment_num'] + $posts['speed_star_num']) / $comment_num; /*计算平均质量星级*/ $quality_star_num = ($shop_info['quality_star_num'] * $shop_info['comment_num'] + $posts['quality_star_num']) / $comment_num; /*计算平均服务星级*/ $serve_star_num = ($shop_info['serve_star_num'] * $shop_info['comment_num'] + $posts['serve_star_num']) / $comment_num; /*计算平均综合星级*/ $new_star_num = round(($shop_info['star_num'] * $shop_info['comment_num'] + $star_num) / $comment_num, 1); $_POST = array('id' => $order_info['shop_id'], 'speed_star_num' => $speed_star_num, 'quality_star_num' => $quality_star_num, 'serve_star_num' => $serve_star_num, 'star_num' => $new_star_num, 'comment_num' => $comment_num); $res2 = update_data($this->shop_table); /*将订单评论状态改为已评论状态*/ $_POST = array('id' => $order_id, 'is_comment' => 1); $res3 = update_data($this->table); /*将订单状态信息跟新到历史记录表中*/ $_POST = array('order_id' => $order_id, 'order_status' => '7', 'description' => '评价订单成功'); $res4 = update_data($this->history_table); if (is_numeric($res) && is_numeric($res2) && is_numeric($res3) && is_numeric($res4)) { /*都执行成功提交事务*/ $Model->commit(); if (!empty($posts['save_path'])) { /*如果上传了图片则将图片更新到评论图片信息表中*/ multi_file_upload($posts['save_path'], 'Uploads/Orders/comment', $this->comment_image, 'comment_id', $res, 'save_path'); } $cache_name = 'shop_comment_count_' . $order_info['shop_id']; F($cache_name, null); $tips_msg = array('status' => '1', 'msg' => '评论添加成功', 'url' => U('index')); } else { /*其中之一执行失败则回滚事务*/ $Model->rollback(); $tips_msg = array('status' => '0', 'msg' => '评论添加失败', 'url' => U('index')); } export: if ($tips_msg['status'] == 1) { $this->success($tips_msg['msg'], $tips_msg['url']); } else { $this->error($tips_msg['msg'], $tips_msg['url']); } } else { $gets = I('get.'); $order_id = $gets['order_id']; $map['id'] = $order_id; $map['status'] = 3; $order_info = get_info($this->table, $map); if ($order_info['is_comment'] > 0) { /*判断是否已经评论过*/ $tips_msg = array('status' => '0', 'msg' => '订单已经评论过', 'url' => U('index')); $status = true; } $coment_count = get_shops_comment_count($order_info['shop_id']); if ($status) { $this->error($tips_msg['msg'], $tips_msg['url']); } $data['order_id'] = $order_id; /*@liuqiao 改*/ if (I('get.type')) { $map = array('type' => I('get.type')); } else { $map = array('type' => array(in, array(1, 2, 3))); } $comments = $this->get_shop_comments(); //dump($comments); $this->assign($comments); //$data['goods_results']=get_result('comment',$map);//查出该产品的所有评价 $data['coment_count'] = $coment_count; $data['type'] = I('get.type'); $this->assign($data); $this->display(); } }
/** * 发送信息 * @author 李东 * @date 2015-06-29 */ function send_msg() { if (IS_POST) { $posts = I('post.'); $member_id = session('home_member_id'); $to_user_info = get_info('member', array('username|telephone' => trim($posts['username']))); //判断收件人是否存在 if (!$to_user_info) { $this->error('用户不存在'); } else { if ($to_user_info['id'] == $member_id) { $this->error('收信人不能为自己'); } if (empty($posts["content"])) { $posts["content"] = $posts['title']; } $_POST = array('from_member_id' => $member_id, 'to_member_id' => $to_user_info['id'], 'title' => $posts['title'], 'content' => $posts['content'], 'accessory_path' => $posts['accessory_path'], 'username' => trim($posts['username']), 'type' => 3, 'status' => 1); /* 定义添加验证规则 */ $rules = array(array('username', 'require', '收件人不能为空'), array('title', 'require', '标题不能为空'), array('content', 'require', '请填内容')); $result = update_data($this->table, $rules); $get_friend = $this->add_friends($_POST); //增加联系人 if (is_numeric($result)) { /*将附件地址更新到数据库*/ multi_file_upload($posts['accessory_path'], 'Uploads/Message/accessory', $this->table, 'id', $result, 'accessory_path'); $this->success('操作成功', U('index')); } else { $this->error($result); } } } else { $gets = I('get.'); $to_member_id = $gets['member_id']; $user_name = ''; if ($to_member_id) { $map['id'] = $to_member_id; $user_info = get_info('member', $map, 'username'); $user_name = $user_info['username']; } $data['username'] = $user_name; $this->assign($data); $this->display(); } }
public function update() { if (IS_POST) { $posts = I('post.'); /* 定义添加验证规则 */ $rule = array(array('title', 'require', '标题必须填写', 1), array('good_at', 'require', '请选择擅长语言', 1), array('short_description', 'require', '请填写简介', 1)); /* $str=''; foreach($posts['good_at'] as $value){ $str .=$value.','; } */ $member_info = get_info('member', array('username|telephone|email' => $posts['username'])); $member_id = $member_info['id']; if (!$member_id) { $this->error('所属用户未填写或填写的用户不存在'); } // $good_at = substr($str,0,-1);/*将擅长组装成字符串*/ $good_at = json_encode($posts['good_at']); $_POST = array('id' => $posts['id'], 'logo' => $posts['logo'], 'title' => $posts['title'], 'slogan' => $posts['slogan'], 'member_id' => $member_id, 'type' => $posts['type'], 'short_description' => $posts['short_description'], 'description_now' => $posts['description_now'], 'description_old' => $posts['description_old'], 'good_at' => $good_at, 'keywords' => $posts['keywords']); $result = update_data($this->table, $rule); /* 判断执行操作是否成功 */ if (is_numeric($result)) { /*将店铺logo更新到数据库*/ multi_file_upload($posts['logo'], 'Uploads/Shop', 'shop', 'id', $result, 'logo'); F($this->cache_name, null); /* 操作成功清除缓存 */ $this->success('操作成功', U('index', array('pid' => intval(I('post.pid'))))); } else { $this->error($result); } } else { $this->error('违法操作', U('index')); } }
/** *公司信息设置 * 设置店铺的相关信息 *流程分析 * 1、判断用户是否开店 * 2、查询显示用户的信息 **/ public function index() { if (session('home_shop_id')) { $shop_id = session('home_shop_id'); if (IS_POST) { // dump(I('post.'));die; $slogan = I('slogan'); $slogan_count = mb_strlen($slogan, 'UTF8'); $good_at = json_encode(I('good_at')); //$good_at = implode(',',$good_at); $description_now = addslashes(I('content')); //验证信息,一句话概述不能超过20字 if ($slogan_count > 20) { $tips_msg = array('status' => 0, 'info' => '一句话概述不能超过20字'); $this->appOut($tips_msg, $this->apptype, 0); //$this->error('一句话概述不能超过20字','',$ajax); } else { $logo = intval(I("post.logo")); if (strtotime(I('regtime')) >= time()) { $tips_msg = array('status' => 0, 'info' => '成立时间不能比当前时间晚'); $this->appOut($tips_msg, $this->apptype, 0); } //获取用户输入的营业时间 $time_s_1 = I('time_s_1'); $time_s_2 = I('time_s_2'); $time_s_3 = I('time_s_3'); $time_s_4 = I('time_s_4'); if ($time_s_1 > $time_s_3) { $this->error('周一至周五的营业时间设置错误'); } else { if ($time_s_1 == $time_s_3 && $time_s_2 > $time_s_4) { $this->error('周一至周五的营业时间设置错误'); } } $time_e_1 = I('time_e_1'); $time_e_2 = I('time_e_2'); $time_e_3 = I('time_e_3'); $time_e_4 = I('time_e_4'); if ($time_e_1 > $time_e_3) { $this->error('周六至周日的营业时间设置错误'); } else { if ($time_e_1 == $time_e_3 && $time_e_2 > $time_e_4) { $this->error('周六至周日的营业时间设置错误'); } } $time_s = array("{$time_s_1}", "{$time_s_2}", "{$time_s_3}", "{$time_s_4}"); $time_e = array("{$time_e_1}", "{$time_e_2}", "{$time_e_3}", "{$time_e_4}"); //营业时间 $work_time_s = json_encode($time_s); $work_time_e = json_encode($time_e); // $work_time_s = I('time_s_1')."~".I('time_s_2')."~".I('time_s_3')."~".I("time_s_4"); // $work_time_e = I('time_e_1')."~".I('time_e_2')."~".I("time_e_3")."~".I("time_e_4"); // dump($work_time_e);die; //组织将信息修改到数据表中 $_POST = array('id' => $shop_id, 'title' => I('title'), 'logo' => I('logo'), 'area_id' => I('area'), 'address' => I('detailAddress'), 'regtime' => I('regtime'), 'good_at' => $good_at, 'orgood_at' => I('post.good_at'), 'work_time_s' => $work_time_s, 'work_time_e' => $work_time_e, 'slogan' => $slogan, 'description_now' => $description_now); $rules = array(array("title", "require", "名称不能为空"), array("logo", "require", "logo不能为空", 1), array("area_id", "require", "联系地址不能为空"), array("address", "require", "详细地址不能为空"), array("regtime", "require", "成立时间不能为空"), array("orgood_at", "checkArray", "擅长语言不能为空", 1, 'function'), array("work_time_s", "require", "营业时间不能为空"), array("work_time_e", "require", "营业时间不能为空"), array("slogan", "require", "概述不能为空"), array("description_now", "require", "介绍不能为空")); //判断店铺名称是否重名 if (!empty($_POST['title'])) { $map = array("title" => array("eq", $_POST['title']), "id" => array("neq", $shop_id)); $info = get_info($this->table, $map); if ($info) { $tips_msg = array('status' => 0, 'info' => '店铺名称已经被占用,请重新取名!!'); $this->appOut($tips_msg, $this->apptype, 0); } } //数据更新 $result = update_data($this->table, $rules); if (is_numeric($result)) { if ($logo) { multi_file_upload($logo, 'Uploads/Shop/license', $this->table, 'id', $result, 'logo'); } $tips_msg = array('status' => 1, 'info' => '修改成功!', 'url' => U('User/CompanyInfo/index')); $this->appOut($tips_msg, $this->apptype, 0); //$this->success('修改成功!',U('User/CompanyInfo/index'),$ajax); } else { $tips_msg = array('status' => 0, 'info' => $result, 'url' => U('User/CompanyInfo/index')); $this->appOut($tips_msg, $this->apptype, 0); //$this->error('修改失败!',U('User/CompanyInfo/index'),$ajax); } } } else { $this->companyinfo(); } } else { //$this->error('您的店铺尚未开通!',U('Home/Index/index'),$this->apptype); $tips_msg = array('status' => 1, 'info' => '您的店铺尚未开通!', 'url' => U('Home/Index/index')); $this->appOut($tips_msg, $this->apptype, 0); } }
/** *店铺管理 * 个人译者和翻译公司的店铺管理有所不同,需要做一定的判断处理 *流程分析 * 1、店铺的申请 * 按照用户登录的类型店铺的申请分为个人译者店铺的申请和翻译公司店铺的申请 * 个人译者的店铺申请所上传的资料是身份证、学历证书、资质证书 * 公司翻译的店铺申请所上传的资料是营业执照、税务登记、资质证书 * 2、店铺的审核 * 店铺上传资料之后就会由后台审核,审核的过程中商铺可以修改上传的资质 * 3、店铺申请成功 * 店铺申请成功之后店铺的资料只能修改店铺介绍 *@author 刘浩 <qq:372980503> *@time 2015-07-20 **/ public function index() { if (IS_POST) { //不考虑app端的 $posts = I("post."); //$type = session('type'); //$shop_id = session('home_shop_id'); //重新获取店铺信息 $member_id = session("home_member_id"); $info = get_info(D('ShopMemberView'), array("member.id" => $member_id)); $type = $info["type"]; $shop_id = $info["shop_id"]; if ($type == 3 or $type == 2) { $_POST['id'] = $shop_id; if ($type == 3) { $_POST['type'] = 2; //翻译公司 $title_msg = "公司名称不能为空"; $content_msg = "公司介绍不能为空!"; $license_msg = "营业执照正面不能为空!"; $license_msg_1 = "营业执照反面不能为空!"; $tax_msg = "税务登记证不能为空!"; } else { if ($type == 2) { $_POST['type'] = 1; //个人译者 $title_msg = "店铺名称不能为空"; $content_msg = "店铺介绍不能为空!"; $license_msg = "身份证正面不能为空!"; $license_msg_1 = "身份证反面不能为空!"; $tax_msg = "学历证书不能为空!"; } } if (empty($shop_id)) { $_POST["member_id"] = session("home_member_id"); } $_POST['status'] = 0; //表示正在审核 $_POST['operate_type1'] = $_POST['operate_type']; $_POST['operate_type'] = json_encode($_POST['operate_type']); $_POST['translate_type'] = json_encode($_POST['servece_type']); $_POST['description_now'] = htmlspecialchars($_POST['content']); //判断店铺名称是否重名 if (!empty($_POST['title'])) { if ($shop_id) { $map = array("title" => array("eq", $_POST['title']), "id" => array("neq", $shop_id)); } else { $map = array("title" => array("eq", $_POST['title'])); } $match_result = get_info($this->table, $map); if ($match_result) { $this->error('店铺名称已经被占用,请重新取名!!'); } } //判断店铺是否已审核通过 //$info = get_info($this->table,array("id"=>$shop_id)); if ($info['shop_status'] == 1) { $this->error('您的店铺已经审核通过,不可再次修改!'); } else { if ($info['shop_status'] == 2) { $this->error('您的店铺已被冻结,无法进行修改!'); } } //验证资质证书 if (empty($_POST["image1"]) and empty($_POST["image"])) { $_POST["images"] = ""; } else { $_POST["images"] = 1; } //验证信息的正确性 $rules = array(array('title', 'require', $title_msg, 1), array('operate_type1', 'checkArray', '业务范围不能为空', 1, 'function'), array('servece_type', 'checkArray', '服务类别不能为空', 1, 'function'), array('translate_num', 'require', '日翻译量不能为空', 1), array('translate_year', 'require', '翻译年限不能为空!', 1), array('translate_year', 'number', '翻译年限必须为数字!'), array('shop_license', 'require', $license_msg, 1), array('shop_license_1', 'require', $license_msg_1, 1), array('shop_tax', 'require', $tax_msg, 1), array('images', 'require', '翻译资质证书不能为空', 1), array('content', 'require', $content_msg)); /*@刘巧 判断用户店铺名是否符合规范*/ $_POST['title'] = get_word_search($_POST['title']); //组织上传信息 /* unset($_POST); $_POST = array( 'id'=>$shop_id, 'title'=>$parameters['title'], 'type'=>$type, 'short_description'=>$parameters['content'], 'status'=>3, 'operate_type'=>json_encode($parameters['operate_type']), 'translate_type'=>json_encode($parameters['servece_type']), 'translate_year'=>$parameters['translate_year'], 'traslate_num'=>$parameters['translate_num'], ); */ $result = update_data($this->table, $rules); if (is_numeric($result)) { //将店铺的营业执照存入对应的文件夹,对应的字段 if (is_numeric($posts['shop_license'])) { multi_file_upload($posts['shop_license'], 'Uploads/Shop/license', $this->table, 'id', $result, 'shop_license'); } if (is_numeric($posts['shop_license_1'])) { multi_file_upload($posts['shop_license_1'], 'Uploads/Shop/license', $this->table, 'id', $result, 'shop_license_1'); } //将店铺的税务登记证或者是个人译者的学历证书图片存入之地呢的文件夹和对应的字段 if (is_numeric($posts['shop_tax'])) { multi_file_upload($posts['shop_tax'], 'Uploads/Shop/license', $this->table, 'id', $result, 'shop_tax'); } //将店铺的翻译资质存入到shop_image if ($posts['image']) { multi_file_upload(array_unique($posts['image']), 'Uploads/Shop/license', $this->shop_image, 'shop_id', $result, 'image'); } $content = C('SHOPZILIAO'); $account = session('home_member_tel'); $status = send_code($content, $account); $this->success('提交成功'); } else { $this->error($result); } } else { $this->error("您还未开店或者不是公司账号"); } } else { $member_id = session('home_member_id'); //获取业务范围缓存 $operate_type = get_operate_cache(); //指的是翻译、审稿、校对、母语审稿、同声传译、陪同翻译 //定义服务类别 $servece_type = array('中译外', '外译外', '外译中'); //这个是固定的,后台不能做出修改的 //判断用户是否开店 //使用member_id查找店铺列表中是否存在status是1或3的店铺,如果没有就显示让其上传资料,上传资料的时候分为两种一种是翻译公司一种是个人译者 //如果是开店的就显示其上传的认证信息 //如果是没有开店的就显示店铺申请的信息 $info = get_info(D('MemberShopView'), array('shop.member_id' => $member_id)); $data['operate_type'] = $operate_type; $data['servece_type'] = $servece_type; if ($info) { //开了店的或者是正在审核中的店铺 $info['operate_type'] = json_decode($info['operate_type']); $info['translate_type'] = json_decode($info['translate_type']); $data['info'] = $info; //获取资质证书 $shop_image = get_result("shop_image", array("shop_id" => $info["shop_id"])); $data['shop_image'] = $shop_image; $this->assign($data); if ($info['shop_status'] == 1 or $info['shop_status'] == 2) { //表示店铺审核通过或冻结 $this->display('index2'); } else { //表示店铺正在审核的 $this->display('index'); } } else { if (session("type") < 2) { $this->redirect('User/Index/index'); } else { $this->assign($data); $this->display('index'); } } /* $ParameterArray['data']['operate_type'] = $operate_type; $ParameterArray['data']['servece_type'] = $servece_type; $this->ReturnParameter($ParameterArray); */ } }