/** * 返回分类规格属性 */ public function type_infoOp() { $gc_id = intval($_POST['gc_id']); $model_goods_class = Model('goods_class'); $goods_class = $model_goods_class->getGoodsClassLineForTag($gc_id); $type_id = intval($goods_class['type_id']); $spec_list = array(); $attr_list = array(); if ($type_id > 0) { list($spec_json, $spec_list, $attr_list, $brand_list) = Model('type')->getAttr($goods_class['type_id'], $this->store_info['store_id'], $gc_id); $temp = array(); foreach ($spec_list as $key => $value) { $value['sp_id'] = $key; $temp[] = $value; } $spec_list = $temp; $temp = array(); foreach ($attr_list as $key => $value) { $value['attr_id'] = $key; $temp[] = $value; } $attr_list = $temp; } output_data(array('type_id' => $type_id, 'spec_list' => $spec_list, 'attr_list' => $attr_list)); }
/** * 商品评价详细页 */ public function comments_listOp() { $goods_id = intval($_GET['goods_id']); // 商品详细信息 $model_goods = Model('goods'); $goods_info = $model_goods->getGoodsInfoByID($goods_id, '*'); // 验证商品是否存在 if (empty($goods_info)) { output_error('商品不存在'); } //评价信息 $goods_evaluate_info = Model('evaluate_goods')->getEvaluateGoodsInfoByGoodsID($goods_id); $buy_comments['goods_evaluate_info']['good'] = $goods_evaluate_info['good']; $buy_comments['goods_evaluate_info']['normal'] = $goods_evaluate_info['normal']; $buy_comments['goods_evaluate_info']['bad'] = $goods_evaluate_info['bad']; $buy_comments['goods_evaluate_info']['all'] = $goods_evaluate_info['all']; $buy_comments['goods_evaluate_info']['good_percent'] = $goods_evaluate_info['good_percent']; $buy_comments['goods_evaluate_info']['normal_percent'] = $goods_evaluate_info['normal_percent']; $buy_comments['goods_evaluate_info']['bad_percent'] = $goods_evaluate_info['bad_percent']; $buy_comments['goods_evaluate_info']['good_star'] = $goods_evaluate_info['good_star']; $buy_comments['goods_evaluate_info']['star_average'] = $goods_evaluate_info['star_average']; $buy_comments['comments'] = $this->_get_comments($goods_id, $_GET['type'], 5); $buy_comments['goods_evaluate_info']['page'] = $this->_getcomments($goods_id, $_GET['type'], 5); if (empty($buy_comments['comments'])) { output_error('暂时没有评论'); } if ($buy_comments['goods_evaluate_info']['page']['page'] > $buy_comments['goods_evaluate_info']['page']['show_pa']) { $buy_comments['comments'] = null; } output_data($buy_comments); }
/** * 登录 */ public function indexOp() { if (empty($_POST['seller_name']) || empty($_POST['password']) || !in_array($_POST['client'], $this->client_type_array)) { output_error('用户名密码不能为空'); } $model_seller = Model('seller'); $seller_info = $model_seller->getSellerInfo(array('seller_name' => $_POST['seller_name'])); if (!$seller_info) { output_error('登录失败'); } //店铺所有人或者授权的子账号可以从客户端登录 if (!($seller_info['is_admin'] || $seller_info['is_client'])) { output_error('权限验证失败'); } //验证身份 $model_member = Model('member'); $member_info = $model_member->getMemberInfo(array('member_id' => $seller_info['member_id'], 'member_passwd' => strtolower($_POST['password']))); if (!$member_info) { output_error('用户名密码错误'); } //读取店铺信息 $model_store = Model('store'); $store_info = $model_store->getStoreInfoByID($seller_info['store_id']); //更新卖家登陆时间 $model_seller->editSeller(array('last_login_time' => TIMESTAMP), array('seller_id' => $seller_info['seller_id'])); //生成登录令牌 $token = $this->_get_token($seller_info['seller_id'], $seller_info['seller_name'], $_POST['client']); if ($token) { output_data(array('seller_name' => $seller_info['seller_name'], 'store_name' => $store_info['store_name'], 'key' => $token)); } else { output_error('登录失败'); } }
/** * 地址列表 */ public function voucher_listOp() { $model_voucher = Model('voucher'); $voucher_list = $model_voucher->getMemberVoucherList($this->member_info['member_id'], $_POST['voucher_state'], $this->page); $page_count = $model_voucher->gettotalpage(); output_data(array('voucher_list' => $voucher_list), mobile_page($page_count)); }
/** * 获取推荐商品列表 */ public function get_recommend_goods_listOp() { $recommend_goods_list = Model('goods_class')->getGoodsClassListByParentId(0); if ($recommend_goods_list) { $model_goods = Model('goods'); foreach ($recommend_goods_list as $k => $v) { $goods_list = $model_goods->getGeneralGoodsOnlineList(array('gc_id_1' => $v['gc_id']), 'goods_id,goods_name,goods_price,goods_promotion_price,goods_promotion_type,distribution_price,goods_storage,goods_marketprice,goods_image', 6, 'goods_salenum desc'); if ($goods_list) { foreach ($goods_list as $kk => $vv) { if ($vv['goods_promotion_type'] > 0) { $goods_list[$kk]['goods_price'] = $vv['goods_promotion_price']; } elseif ($vv['distribution_price'] > 0) { $goods_list[$kk]['goods_price'] = $vv['distribution_price']; } $goods_list[$kk]['img_url'] = thumb($vv, 360); $goods_list[$kk]['discount'] = sprintf('%0.1f', $goods_list[$kk]['goods_price'] / $vv['goods_marketprice'] * 10); } $recommend_goods_list[$k]['list'] = $goods_list; } else { unset($recommend_goods_list[$k]); } } } output_data(array('recommend_goods_list' => $recommend_goods_list)); }
public function designer_work_listOp() { error_reporting(0); $post = $this->read_json(); $arr = OTA($post); $_REQUEST = array_merge($_REQUEST, $arr); // var_dump($_REQUEST); // exit(); // $arr=objectToArray($post); // $_REQUEST=array_merge($_REQUEST,$arr); // $goods_id = intval($_REQUEST ['goods_id']); $model_designer_work = Model('designer_work'); // // $model_search = Model('search'); // // $condition['designer_work.sn_if_show']=1; // if(!empty($_REQUEST['id']) && intval($_REQUEST['id']) > 0) { // $condition = " and designer_work.id=".$_REQUEST['id']; // } elseif (!empty($_REQUEST['conditions']['matchValue'])) { // $condition['designer_work.sn_name|designer_work.sn_content'] = array('like', '%' . $_REQUEST['conditions']['matchValue'] . '%'); // } //$condition['sn_name|sn_content'] = array('like', '%' . 'abc'. '%'); // output_data(array('desginers_work_list' => $post)); $field = 'designer_work.id,designer_work.sn_collect,designer_work.sn_category,designer_work.sn_style,designer_work.sn_m_pic,designer_work.sn_work_pic,designer_work.sn_area,designer_work.sn_cost,designer_work.sn_content,designer_work.sn_add_time,designer_work.sn_house_type,designer_work.sn_collection_count,designer_work.sn_share_count,designer_work.sn_designer_id,designer.sn_title,designer_work.sn_name,designer.sn_head,designer.sn_designer_style,designer.sn_designer_enter_time,designer.sn_designer_collect,designer.sn_store_id,designer.sn_store_name'; $designers_work_list = $model_designer_work->getDesignerWorkList($post->conditions, $field, $_REQUEST['pageCount']); // var_dump($designers_work_list); // output_data(array('desginers_work_list' => $post)); $page_count = $model_designer_work->gettotalpage(); //优先从全文索引库里查找 output_data(array('desginers_work_list' => $designers_work_list), mobile_page($page_count)); }
public function getTeamMemberRankOp() { $city_info = array(); $city_info['team_type'] = 0; $city_info['city_school_id'] = intval($_GET["city_school_id"]); $team_member_info = Model('mz_member')->getMemberInfo(array('member_id' => $this->member_info['member_id']), "*", array('mz_team')); if (!empty($team_member_info['extend_team_info'])) { $city_info['team_type'] = $team_member_info['extend_team_info']['team_type']; if ($city_info['city_school_id'] == 0) { $city_info['city_school_id'] = $team_member_info['extend_team_info']['city_school_id']; } } if ($city_info['team_type'] == 0) { $city_info['provinceid'] = Model("area")->where(array('area_id' => $city_info['city_school_id']))->get_field("area_parent_id"); } else { $city_info['provinceid'] = Model("school")->where(array('id' => $city_info['city_school_id']))->get_field("province_id"); } $condition = array(); $condition['mz_team.city_school_id'] = $city_info['city_school_id']; $condition['mz_team.team_status'] = 1; $team_member_list = Model()->table('mz_member,mz_team')->field("mz_member.*,mz_team.team_name")->join('left')->on("mz_member.team_id = mz_team.team_id")->where($condition)->order("integral desc")->limit(10)->select(); if (!empty($team_member_list)) { foreach ($team_member_list as $key => $value) { $team_member_list[$key]['member_name'] = Model("member")->where(array('member_id' => $value['member_id']))->get_field('member_name'); } } output_data(array("data" => array('team_member_list' => $team_member_list, 'city_info' => $city_info))); }
private function _get_Own_Store_List() { $model_store = Model('store'); //查询条件 $condition = array(); if (!empty($_GET['sc_id']) && intval($_GET['sc_id']) > 0) { $condition['sc_id'] = $_GET['sc_id']; } elseif (!empty($_GET['keyword'])) { //$condition['store_name'] = array('like', '%' . $_GET['keyword'] . '%'); } //所需字段 $fields = "*"; //排序方式 $order = $this->_store_list_order($_GET['key'], $_GET['order']); $store_list = $model_store->where($condition)->order($order)->page(10)->select(); $page_count = $model_store->gettotalpage(); $own_store_list = $store_list; $simply_store_list = array(); foreach ($own_store_list as $key => $value) { $simply_store_list[$key]['store_id'] = $own_store_list[$key]['store_id']; $simply_store_list[$key]['store_name'] = $own_store_list[$key]['store_name']; $simply_store_list[$key]['store_address'] = $own_store_list[$key]['store_address']; $simply_store_list[$key]['store_area_info'] = $own_store_list[$key]['area_info']; } output_data(array('store_list' => $simply_store_list), mobile_page($page_count)); }
/** * GET 属于某服务的所有单位 */ public function companiesOp() { $model_company = Model('company'); $condition['ac_id'] = intval($_GET['service_id']); $condition['like_title'] = trim($_GET['search_title']); $company_list = $model_company->getcompanyList($condition); output_data(array('companies' => $company_list)); }
public function getpWpayOp() { $pay_sn = $_REQUEST['pay_sn']; $payment_api = $this->_get_payment_api(); $return = $payment_api->getpWpay($pay_sn); //return $return; output_data(array('prepay_id' => $return), $payment_api->parameters); }
public function indexOp() { $article_class_model = Model('article_class'); $article_model = Model('article'); $condition = array(); $article_class = $article_class_model->getClassList($condition); output_data(array('article_class' => $article_class)); }
public function image_uploadOp() { $logic_goods = Logic('goods'); $result = $logic_goods->uploadGoodsImage($_POST['name'], $this->seller_info['store_id'], $this->store_grade['sg_album_limit']); if (!$result['state']) { output_error($result['msg']); } output_data(array('image_name' => $result['data']['name'])); }
/** * 我的商城 */ public function indexOp() { $member_info = array(); $member_info['user_name'] = $this->member_info['member_name']; $member_info['avator'] = getMemberAvatarForID($this->member_info['member_id']); $member_info['point'] = $this->member_info['member_points']; $member_info['predepoit'] = $this->member_info['available_predeposit']; output_data(array('member_info' => $member_info)); }
/** * 自提物流列表 */ public function get_zt_listOp() { $express_list = rkcache('express', true); foreach ($express_list as $k => $v) { if ($v['e_zt_state'] == '0') { unset($express_list[$k]); } } output_data(array('express_array' => $express_list)); }
public function recommend_listOp() { $brand_list = Model('brand')->getBrandPassedList(array('brand_recommend' => '1'), 'brand_id,brand_name,brand_pic'); if (!empty($brand_list)) { foreach ($brand_list as $key => $val) { $brand_list[$key]['brand_pic'] = brandImage($val['brand_pic']); } } output_data(array('brand_list' => $brand_list)); }
/** * 根据分类编号返回下级分类列表 */ private function _get_class_list($gc_id) { $trade_child_class = Model('resources_class')->getNextLevelGoodsClassById($gc_id); foreach ($trade_child_class as $child_class) { $class_item = array(); $class_item['gc_id'] .= $child_class['gc_id']; $class_item['gc_name'] .= $child_class['gc_name']; $class_list[] = $class_item; } output_data(array('class_list' => $class_list)); }
public function recommend_voucherOp() { //开启代金券功能后查询推荐的热门代金券列表 if (C('voucher_allow') == 1) { $recommend_voucher = Model('voucher')->getRecommendTemplate(6); output_data(array('vouchers' => $recommend_voucher)); } else { output_error("并没有开启代金券功能"); die; } }
/** * android客户端版本号 */ public function apk_versionOp() { $version = C('mobile_apk_version'); $url = C('mobile_apk'); if (empty($version)) { $version = ''; } if (empty($url)) { $url = ''; } output_data(array('version' => $version, 'url' => $url)); }
public function dwindexOp() { $model_db = Model('decoration'); $condition['dw_id'] = intval($_REQUEST['dw_id']); $result = $model_db->getRequestInfo($condition); $result = $model_db->getExtWorkUser($result); if ($result) { output_data(array('dw' => $result)); } else { output_error('10500'); } }
public function designer_listOp() { $model_designers = Model('designer'); // $post=$this->read_json(); $post = $this->read_json(); $arr = OTA($post); $_REQUEST = array_merge($_REQUEST, $arr); // $designers_list = $model_designers->getDesignerListPage($post->conditions, $_REQUEST['pageCount'], 0, '*', '', $post->sortType); $page_count = $model_designers->gettotalpage(); output_data(array('desginers_list' => $designers_list), mobile_page($page_count)); }
public function indexOp() { /** * 此处读取micro_personal_class表中的分类 */ $model_service_class = Model('company_class'); //取分类 $condition = array(); // $condition['where'] = array('class_show' => 1); $condition['class_show'] = 1; $service_class_list = $model_service_class->getClassList($condition); output_data(array('service_class' => $service_class_list)); }
/** * 地区列表 */ public function area_listOp() { $area_id = intval($_GET['area_id']); $model_area = Model('area'); $condition = array(); if ($area_id > 0) { $condition['area_parent_id'] = $area_id; } else { $condition['area_deep'] = 1; } $area_list = $model_area->getAreaList($condition, 'area_id,area_name'); output_data(array('area_list' => $area_list)); }
public function mapOp() { $ch = curl_init("http://api.map.baidu.com/location/ip?ak=AC567a85b2886efaaafa2aa09f683fbd&coor=bd09ll"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // 获取数据返回 curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); // 在启用 CURLOPT_RETURNTRANSFER 时候将获取数据返回 $baiduresult = curl_exec($ch); $baiduresult = json_decode($baiduresult, true); curl_close($ch); // $model_store = Model('store'); // $shop_list = $model_store->getShowList(); output_data($baiduresult); }
/** * 单篇文章显示 */ public function article_showOp() { $article_model = Model('article'); if (!empty($_GET['article_id']) && intval($_GET['article_id']) > 0) { $article = $article_model->getOneArticle(intval($_GET['article_id'])); if (empty($article)) { output_error('文章不存在'); } else { output_data($article); } } else { output_error('缺少参数:文章编号'); } }
/** * 结算列表 * */ public function listOp() { $model_bill = Model('vr_bill'); $condition = array(); $condition['ob_store_id'] = $this->store_info['store_id']; if (preg_match('/^\\d+$/', $_POST['ob_id'])) { $condition['ob_id'] = intval($_POST['ob_id']); } if (is_numeric($_POST['bill_state'])) { $condition['ob_state'] = intval($_POST['bill_state']); } $bill_list = $model_bill->getOrderBillList($condition, '*', $this->page, 'ob_state asc,ob_id asc'); $page_count = $model_bill->gettotalpage(); output_data(array('bill_list' => $bill_list), mobile_page($page_count)); }
/** * 修改订单状态 */ private function change_order_state($state_type, $extend_msg = '') { $order_id = intval($_POST['order_id']); $model_order = Model('order'); $condition = array(); $condition['order_id'] = $order_id; $condition['buyer_id'] = $this->member_info['member_id']; $order_info = $model_order->getOrderInfo($condition); $result = $model_order->memberChangeState($state_type, $order_info, $this->member_info['member_id'], $this->member_info['member_name'], $extend_msg); if (empty($result['error'])) { output_data('1'); } else { output_error($result['error']); } }
/** * 单篇文章显示 */ public function article_showOp() { $article_model = Model('cms_article'); if (!empty($_GET['article_id']) && intval($_REQUEST['article_id']) > 0) { $condition['article_id'] = $_REQUEST['article_id']; $article = $article_model->getOne($condition); if (empty($article)) { output_error('文章不存在'); } else { output_data($article); } } else { output_error('缺少参数:文章编号'); } }
/** * 注销 */ public function indexOp() { if (empty($_POST['seller_name']) || !in_array($_POST['client'], $this->client_type_array)) { output_error('参数错误'); } $model_mb_seller_token = Model('mb_seller_token'); if ($this->seller_info['seller_name'] == $_POST['seller_name']) { $condition = array(); $condition['seller_id'] = $this->seller_info['seller_id']; $model_mb_seller_token->delSellerToken($condition); output_data('1'); } else { output_error('参数错误'); } }
public function indexOp(){ $model_mb_ad = Model('mb_ad'); $model_mb_home = Model('mb_home'); $datas = array(); //广告 $adv_list = array(); $mb_ad_list = $model_mb_ad->getMbAdList(array(), null, 'link_sort asc'); foreach ($mb_ad_list as $value) { $adv = array(); $adv['image'] = $value['link_pic_url']; $adv['keyword'] = $value['link_keyword']; $adv_list[] = $adv; } //首页 $home_type1_list = array(); $home_type2_list = array(); //$mb_home_list = $model_mb_home->getMbHomeList(array(), null, 'h_sort asc'); // @tsh $advList=array(); $list=Model('adv')->getList(array('ap_id'=>373)); foreach($list as $v){ $advContent=unserialize($v['adv_content']); $advContent['keyword']=$v['adv_title']; $advContent['image']=UPLOAD_SITE_URL.'/shop/adv/'.$advContent['adv_pic']; $advList[]=$advContent; } $datas['adv_list'] = $advList; $mb_home_list=Model('goods')->select(); foreach ($mb_home_list as $value) { $home = array(); $home['image'] = thumb($value,160); $home['title'] = $value['goods_name']; $home['desc'] = $value['goods_jingle']; $home['keyword1'] = ''; $home_type1_list[] = $home; } $datas['home1'] = $home_type1_list; $datas['home2'] = $home_type1_list; output_data($datas); }
/** * 添加反馈 */ public function feedback_addOp() { $model_mb_feedback = Model('mb_feedback'); $param = array(); $param['content'] = $_POST['feedback']; $param['type'] = $this->member_info['client_type']; $param['ftime'] = TIMESTAMP; $param['member_id'] = $this->member_info['member_id']; $param['member_name'] = $this->member_info['member_name']; $result = $model_mb_feedback->addMbFeedback($param); if ($result) { output_data('1'); } else { output_error('保存失败'); } }