/**
  * 收藏列表
  */
 public function favorites_listOp()
 {
     $model_favorites = Model('favorites');
     $model_store = Model('store');
     $favorites_list = $model_favorites->getStoreFavoritesList(array('member_id' => $this->member_info['member_id']), '*', $this->page);
     $page_count = $model_favorites->gettotalpage();
     $store_list = array();
     $favorites_list_indexed = array();
     foreach ($favorites_list as $v) {
         $item = array();
         $item['store_id'] = $v['store_id'];
         $item['store_name'] = $v['store_name'];
         $item['fav_time'] = $v['fav_time'];
         $item['fav_time_text'] = date('Y-m-d H:i', $v['fav_time']);
         $store = $model_store->getStoreInfoByID($v['store_id']);
         $item['goods_count'] = $store['goods_count'];
         $item['store_collect'] = $store['store_collect'];
         $item['store_avatar'] = $store['store_avatar'];
         if ($store['store_avatar']) {
             $item['store_avatar_url'] = UPLOAD_SITE_URL . '/' . ATTACH_STORE . '/' . $store['store_avatar'];
         } else {
             $item['store_avatar_url'] = UPLOAD_SITE_URL . '/' . ATTACH_COMMON . DS . C('default_store_avatar');
         }
         $store_list[] = $item;
     }
     output_data(array('favorites_list' => $store_list), mobile_page($page_count));
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
 public function order_listOp()
 {
     $model_order = Model('order');
     $order_list = $model_order->getStoreOrderList($this->store_info['store_id'], $_POST['order_sn'], $_POST['buyer_name'], $_POST['state_type'], $_POST['query_start_date'], $_POST['query_end_date'], $_POST['skip_off'], '*', array('order_goods'));
     $page_count = $model_order->gettotalpage();
     output_data(array('order_list' => $order_list), mobile_page($page_count));
 }
Exemplo n.º 4
0
 /**
  * 订单列表
  */
 public function order_listOp()
 {
     $model_order = Model('order');
     $condition = array();
     $condition['buyer_id'] = $this->member_info['member_id'];
     $order_list_array = $model_order->getOrderList($condition, $this->page, '*', 'order_id desc', '', array('order_goods'));
     $order_group_list = array();
     $order_pay_sn_array = array();
     foreach ($order_list_array as $value) {
         //显示取消订单
         $value['if_cancel'] = $model_order->getOrderOperateState('buyer_cancel', $value);
         //显示收货
         $value['if_receive'] = $model_order->getOrderOperateState('receive', $value);
         //显示锁定中
         $value['if_lock'] = $model_order->getOrderOperateState('lock', $value);
         //显示物流跟踪
         $value['if_deliver'] = $model_order->getOrderOperateState('deliver', $value);
         $order_group_list[$value['pay_sn']]['order_list'][] = $value;
         //如果有在线支付且未付款的订单则显示合并付款链接
         if ($value['order_state'] == ORDER_STATE_NEW) {
             $order_group_list[$value['pay_sn']]['pay_amount'] += $value['order_amount'];
         }
         $order_group_list[$value['pay_sn']]['add_time'] = $value['add_time'];
         //记录一下pay_sn,后面需要查询支付单表
         $order_pay_sn_array[] = $value['pay_sn'];
     }
     $new_order_group_list = array();
     foreach ($order_group_list as $key => $value) {
         $value['pay_sn'] = strval($key);
         $new_order_group_list[] = $value;
     }
     $page_count = $model_order->gettotalpage();
     output_data(array('order_group_list' => $new_order_group_list), mobile_page($page_count));
 }
Exemplo n.º 5
0
    /**
     * 商品列表
     */
    public function goods_listOp() {
        $model_goods = Model('goods');

        //查询条件
        $condition = array();
        if(!empty($_GET['store_id']) && intval($_GET['store_id']) > 0) {
            $condition['store_id'] = $_GET['store_id'];
        } elseif (!empty($_GET['keyword'])) { 
            $condition['goods_name|goods_jingle'] = array('like', '%' . $_GET['keyword'] . '%');
        }

        //所需字段
        $fieldstr = "goods_id,goods_commonid,store_id,goods_name,goods_price,goods_marketprice,goods_image,goods_salenum,evaluation_good_star,evaluation_count";

        //排序方式
        $order = $this->_goods_list_order($_GET['key'], $_GET['order']);

        $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, $this->page);
        $page_count = $model_goods->gettotalpage();

        //处理商品列表(团购、限时折扣、商品图片)
        $goods_list = $this->_goods_list_extend($goods_list);

        output_data(array('goods_list' => $goods_list), mobile_page($page_count));
    }
Exemplo n.º 6
0
 /**
  * 店铺收藏列表
  *
  * @param
  * @return
  */
 public function dc_favorites_listOp()
 {
     $favorites_model = Model('favorites');
     $favorites_list = $favorites_model->getStoreFavoritesList(array('member_id' => $this->member_info['member_id']), '*', 10);
     $page_count = $model_favorites->gettotalpage();
     if (!empty($favorites_list) && is_array($favorites_list)) {
         $favorites_id = array();
         //收藏的店铺编号
         foreach ($favorites_list as $key => $favorites) {
             $fav_id = $favorites['fav_id'];
             $favorites_id[] = $favorites['fav_id'];
             $favorites_key[$fav_id] = $key;
         }
         $store_model = Model('store');
         $store_list = $store_model->getStoreList(array('store_id' => array('in', $favorites_id)));
         if (!empty($store_list) && is_array($store_list)) {
             foreach ($store_list as $key => $fav) {
                 $fav_id = $fav['store_id'];
                 $key = $favorites_key[$fav_id];
                 $favorites_list[$key]['store'] = $fav;
             }
         }
     }
     output_data(array('favorites_list' => $favorites_list), mobile_page($page_count));
 }
Exemplo n.º 7
0
 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));
 }
Exemplo n.º 8
0
 /**
  * 地址列表
  */
 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));
 }
Exemplo n.º 9
0
 /**
  * 好友列表
  */
 public function friend_listOp()
 {
     $model_chat = Model('web_chat');
     $member_id = $this->member_info['member_id'];
     $friend_list = $model_chat->getFriendList(array('friend_frommid' => $member_id), $this->page);
     $page_count = $model_chat->gettotalpage();
     output_data(array('friend_list' => $friend_list), mobile_page($page_count));
 }
Exemplo n.º 10
0
 /**
  * GET 专题列表
  */
 public function specialsOp()
 {
     $conition = array();
     $conition['special_state'] = 2;
     $model_special = Model('cms_special');
     $special_list = $model_special->getShopList($conition, $this->page, 'special_id desc');
     $pageCount = $model_special->gettotalpage();
     output_data(array('specials' => $special_list), mobile_page($pageCount));
 }
Exemplo n.º 11
0
 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));
 }
Exemplo n.º 12
0
 /**
  * 订单列表
  */
 public function order_listOp()
 {
     $model_order = Model('order');
     $condition = array();
     $condition['buyer_id'] = $this->member_info['member_id'];
     $order_list_array = $model_order->getNormalOrderList($condition, $this->page, '*', 'order_id desc', '', array('order_goods'));
     $order_group_list = array();
     $order_pay_sn_array = array();
     foreach ($order_list_array as $value) {
         //显示取消订单
         $value['if_cancel'] = $model_order->getOrderOperateState('buyer_cancel', $value);
         //显示收货
         $value['if_receive'] = $model_order->getOrderOperateState('receive', $value);
         //显示锁定中
         $value['if_lock'] = $model_order->getOrderOperateState('lock', $value);
         //显示物流跟踪
         $value['if_deliver'] = $model_order->getOrderOperateState('deliver', $value);
         //商品图
         foreach ($value['extend_order_goods'] as $k => $goods_info) {
             $value['extend_order_goods'][$k]['goods_image_url'] = cthumb($goods_info['goods_image'], 240, $value['store_id']);
         }
         $order_group_list[$value['pay_sn']]['order_list'][] = $value;
         //如果有在线支付且未付款的订单则显示合并付款链接
         if ($value['order_state'] == ORDER_STATE_NEW) {
             $order_group_list[$value['pay_sn']]['pay_amount'] += $value['order_amount'] - $value['rcb_amount'] - $value['pd_amount'];
         }
         $order_group_list[$value['pay_sn']]['add_time'] = $value['add_time'];
         //记录一下pay_sn,后面需要查询支付单表
         $order_pay_sn_array[] = $value['pay_sn'];
     }
     $new_order_group_list = array();
     foreach ($order_group_list as $key => $value) {
         $value['pay_sn'] = strval($key);
         $new_order_group_list[] = $value;
     }
     $page_count = $model_order->gettotalpage();
     $array_data = array('order_group_list' => $new_order_group_list);
     if (isset($_GET['getpayment']) && $_GET['getpayment'] == "true") {
         $model_mb_payment = Model('mb_payment');
         $payment_list = $model_mb_payment->getMbPaymentOpenList();
         //print_r($payment_list);
         $payment_array = array();
         if (!empty($payment_list)) {
             foreach ($payment_list as $value) {
                 $payment_array[] = array('payment_code' => $value['payment_code'], 'payment_name' => $value['payment_name']);
             }
         }
         $array_data['payment_list'] = $payment_array;
     }
     //output_data(array('order_group_list' => $array_data), mobile_page($page_count));
     output_data($array_data, mobile_page($page_count));
 }
Exemplo n.º 13
0
 /**
  * 结算列表
  *
  */
 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));
 }
Exemplo n.º 14
0
 /**
  * 订单列表
  */
 public function order_listOp()
 {
     $model_vr_order = Model('vr_order');
     $condition = array();
     $condition['buyer_id'] = $this->member_info['member_id'];
     $order_list = $model_vr_order->getOrderList($condition, $this->page, '*', 'order_id desc');
     foreach ($order_list as $key => $order) {
         //显示取消订单
         $order_list[$key]['if_cancel'] = $model_vr_order->getOrderOperateState('buyer_cancel', $order);
         //显示支付
         $order_list[$key]['if_pay'] = $model_vr_order->getOrderOperateState('payment', $order);
         $order_list[$key]['goods_image_url'] = cthumb($order['goods_image'], 240, $order['store_id']);
     }
     $page_count = $model_vr_order->gettotalpage();
     output_data(array('order_list' => $order_list), mobile_page($page_count));
 }
Exemplo n.º 15
0
 /**
  * 客户购买商品列表
  */
 public function goods_listOp()
 {
     $model_stat = Model('stat');
     $goods_list = array();
     $condition['store_id'] = $this->store_info['store_id'];
     if (is_numeric($_POST['member_id'])) {
         $condition['buyer_id'] = intval($_POST['member_id']);
     }
     $goods_list = $model_stat->statByStatordergoods($condition, 'store_id,goods_name,goods_image,goods_num,goods_price,order_add_time', $this->page);
     if (!empty($goods_list)) {
         foreach ($goods_list as $key => $val) {
             $goods_list[$key]['gooods_image'] = thumb($val, '240');
         }
     }
     $page_count = $model_stat->gettotalpage();
     output_data(array('goods_list' => $goods_list), mobile_page($page_count));
 }
Exemplo n.º 16
0
 /**
  * GET 服务列表
  */
 public function servicesOp()
 {
     $model_service = Model('serviceapi');
     $model_upload = Model('upload');
     $model = new Model();
     //        //  排序
     $condition = array();
     $condition['service.gc_id'] = intval($_GET['cate_id']);
     $condition['service.service_show'] = 1;
     $service_list = $model->table('service,company')->join('right join')->on('service.depart_id=company.company_id')->where($condition)->page($this->page)->order('service_sort desc')->select();
     //        $service_list = $model_service->geServiceList($condition, '*', 'service_sort asc', $this->page);
     foreach ($service_list as $key => $val) {
         $imgs = $model_upload->getUploadList(array('item_id' => $val['service_id']));
         $service_list[$key]['service_image'] = $imgs[0]['file_name'];
     }
     $pageCount = $model_service->gettotalpage();
     output_data(array('services' => $service_list), mobile_page($pageCount));
 }
Exemplo n.º 17
0
 /**
  * 获取好友动态
  */
 public function trendsOp()
 {
     $id_array = $this->getFollowingsIds();
     $ids = array();
     foreach ($id_array as $val) {
         $ids[] = $val['member_id'];
     }
     $model = Model();
     $m_theme = $model->table('circle_theme');
     //从话题表中查找出关注人的话题,按发布时间排序
     $fields = "theme_id,theme_name,theme_content,circle_id,circle_name,thclass_id,thclass_name,member_id,member_name,theme_addtime";
     $theme_list = $m_theme->where(array('member_id' => array('in', $ids)))->field($fields)->page($this->page)->order('theme_addtime desc')->select();
     foreach ($theme_list as $key => $val) {
         $theme_list[$key]['member_avatar'] = getMemberAvatarForID($theme_list[$key]['member_id']);
     }
     $pageCount = $m_theme->gettotalpage();
     output_data(array('trends' => $theme_list), mobile_page($pageCount));
 }
Exemplo n.º 18
0
 /**
  * 出售中的商品列表
  */
 public function goods_listOp()
 {
     $keyword = $_POST['keyword'];
     $goods_type = $_POST['goods_type'];
     $search_type = $_POST['search_type'];
     $model_goods = Model('goods');
     $condition = array();
     $condition['store_id'] = $this->store_info['store_id'];
     if (trim($keyword) != '') {
         switch ($search_type) {
             case 0:
                 $condition['goods_name'] = array('like', '%' . trim($keyword) . '%');
                 break;
             case 1:
                 $condition['goods_serial'] = array('like', '%' . trim($keyword) . '%');
                 break;
             case 2:
                 $condition['goods_commonid'] = intval($keyword);
                 break;
         }
     }
     $fields = 'goods_commonid,goods_name,goods_price,goods_addtime,goods_image,goods_state,goods_lock';
     switch ($goods_type) {
         case 'lockup':
             $goods_list = $model_goods->getGoodsCommonLockUpList($condition, $fields, $this->page);
             break;
         case 'offline':
             $goods_list = $model_goods->getGoodsCommonOfflineList($condition, $fields, $this->page);
             break;
         default:
             $goods_list = $model_goods->getGoodsCommonOnlineList($condition, $fields, $this->page);
             break;
     }
     // 计算库存
     $storage_array = $model_goods->calculateStorage($goods_list);
     // 整理输出的数据格式
     foreach ($goods_list as $key => $value) {
         $goods_list[$key]['goods_storage_sum'] = $storage_array[$value['goods_commonid']]['sum'];
         $goods_list[$key]['goods_addtime'] = date('Y-m-d', $goods_list[$key]['goods_addtime']);
         $goods_list[$key]['goods_image'] = cthumb($goods_list[$key]['goods_image']);
     }
     $page_count = $model_goods->gettotalpage();
     output_data(array('goods_list' => $goods_list), mobile_page($page_count));
 }
Exemplo n.º 19
0
 /**
  * 收藏列表
  */
 public function favorites_listOp()
 {
     $model_favorites = Model('favorites');
     $favorites_list = $model_favorites->getGoodsFavoritesList(array('member_id' => $this->member_info['member_id']), '*', $this->page);
     $page_count = $model_favorites->gettotalpage();
     $favorites_id = '';
     foreach ($favorites_list as $value) {
         $favorites_id .= $value['fav_id'] . ',';
     }
     $favorites_id = rtrim($favorites_id, ',');
     $model_goods = Model('goods');
     $field = 'goods_id,goods_name,goods_price,goods_image,store_id';
     $goods_list = $model_goods->getGoodsList(array('goods_id' => array('in', $favorites_id)), $field);
     foreach ($goods_list as $key => $value) {
         $goods_list[$key]['fav_id'] = $value['goods_id'];
         $goods_list[$key]['goods_image_url'] = cthumb($value['goods_image'], 240, $value['store_id']);
     }
     output_data(array('favorites_list' => $goods_list), mobile_page($page_count));
 }
Exemplo n.º 20
0
    /**
     * 商品列表
     */
    public function goods_listOp() {
        $model_goods = Model('goods');
        $model_search = Model('search');

        //查询条件
        $condition = array();
        if(!empty($_GET['gc_id']) && intval($_GET['gc_id']) > 0) {
            $condition['gc_id'] = $_GET['gc_id'];
        } elseif (!empty($_GET['keyword'])) {
            $condition['goods_name|goods_jingle'] = array('like', '%' . $_GET['keyword'] . '%');
        }

        //所需字段
        $fieldstr = "goods_id,goods_commonid,store_id,goods_name,goods_price,goods_marketprice,goods_image,goods_salenum,evaluation_good_star,evaluation_count";

        // 添加3个状态字段
        $fieldstr .= ',is_virtual,is_presell,is_fcode,have_gift';

        //排序方式
        $order = $this->_goods_list_order($_GET['key'], $_GET['order']);

        //优先从全文索引库里查找
        list($indexer_ids,$indexer_count) = $model_search->indexerSearch($_GET,$this->page);
        if (is_array($indexer_ids)) {
            //商品主键搜索
            $goods_list = $model_goods->getGoodsOnlineList(array('goods_id'=>array('in',$indexer_ids)), $fieldstr, 0, $order, $this->page, null, false);

            //如果有商品下架等情况,则删除下架商品的搜索索引信息
            if (count($goods_list) != count($indexer_ids)) {
                $model_search->delInvalidGoods($goods_list, $indexer_ids);
            }
            pagecmd('setEachNum',$this->page);
            pagecmd('setTotalNum',$indexer_count);
        } else {
            $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, $this->page);
        }
        $page_count = $model_goods->gettotalpage();

        //处理商品列表(抢购、限时折扣、商品图片)
        $goods_list = $this->_goods_list_extend($goods_list);

        output_data(array('goods_list' => $goods_list), mobile_page($page_count));
    }
Exemplo n.º 21
0
 /**
  * GET 圈子搜索
  */
 public function groupOp()
 {
     $model = Model();
     $where = array();
     $where['circle_status'] = 1;
     if ($_GET['keyword'] != '') {
         $where['circle_name|circle_tag'] = array('like', '%' . $_GET['keyword'] . '%');
     }
     if (intval($_GET['class_id']) > 0) {
         $where['class_id'] = intval($_GET['class_id']);
     }
     $m_circle = $model->table('circle');
     $circle_list = $m_circle->where($where)->page($this->page)->select();
     $pageCount = $m_circle->gettotalpage();
     foreach ($circle_list as $key => $val) {
         //            $cm_info[$key] = Model()->table('circle_member')->where(array('circle_id' => $val['circle_id'], 'member_id' => $this->member_info['member_id']))->find();
         $circle_list[$key]['member_state'] = $this->circle_member_state($val['circle_id'], $this->member_info['member_id']);
     }
     output_data(array('circles' => $circle_list), mobile_page($pageCount));
 }
Exemplo n.º 22
0
 /**
  * 店铺收藏列表 v3-b12
  *
  * @param
  * @return
  */
 public function favorites_storeOp()
 {
     $model_favorites = Model('favorites');
     $favorites_list = $model_favorites->getGoodsFavoritesList(array('member_id' => $this->member_info['member_id']), '*', $this->page);
     $page_count = $model_favorites->gettotalpage();
     $favorites_id = '';
     foreach ($favorites_list as $value) {
         $favorites_id .= $value['fav_id'] . ',';
     }
     $favorites_id = rtrim($favorites_id, ',');
     $model_store = Model('store');
     $field = 'store_name,store_zy,store_id';
     $store_list = $model_store->getStoreList(array('store_id' => array('in', $favorites_id)), $field);
     foreach ($store_list as $key => $value) {
         $store_list[$key]['store_id'] = $value['store_id'];
         $store_list[$key]['store_name'] = $value['store_name'];
         $store_list[$key]['store_zy'] = $value['store_zy'];
     }
     output_data(array('favorites_list' => $store_list), mobile_page($page_count));
 }
Exemplo n.º 23
0
 /**
  * 商品列表
  */
 public function goods_listOp()
 {
     $model_goods = Model('goods');
     $model_search = Model('search');
     $_GET['is_book'] = 0;
     //查询条件
     $condition = array();
     // ==== 暂时不显示定金预售商品,手机端未做。  ====
     $condition['is_book'] = 0;
     // ==== 暂时不显示定金预售商品,手机端未做。  ====
     if (!empty($_GET['gc_id']) && intval($_GET['gc_id']) > 0) {
         $condition['gc_id'] = $_GET['gc_id'];
     } elseif (!empty($_GET['keyword'])) {
         $condition['goods_name|goods_jingle'] = array('like', '%' . $_GET['keyword'] . '%');
     } elseif (!empty($_GET['barcode'])) {
         $condition['goods_barcode'] = $_GET['barcode'];
     } elseif (!empty($_GET['b_id']) && intval($_GET['b_id'] > 0)) {
         $condition['brand_id'] = intval($_GET['b_id']);
     }
     //所需字段
     $fieldstr = "goods_id,goods_commonid,store_id,goods_name,goods_price,goods_promotion_price,goods_promotion_type,goods_marketprice,goods_image,goods_salenum,evaluation_good_star,evaluation_count";
     // 添加3个状态字段
     $fieldstr .= ',is_virtual,is_presell,is_fcode,have_gift';
     //排序方式
     $order = $this->_goods_list_order($_GET['key'], $_GET['order']);
     //优先从全文索引库里查找
     list($goods_list, $indexer_count) = $model_search->indexerSearch($_GET, $this->page);
     if (!is_null($goods_list)) {
         $goods_list = array_values($goods_list);
         pagecmd('setEachNum', $this->page);
         pagecmd('setTotalNum', $indexer_count);
     } else {
         $goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, $this->page);
     }
     $page_count = $model_goods->gettotalpage();
     //处理商品列表(团购、限时折扣、商品图片)
     $goods_list = $this->_goods_list_extend($goods_list);
     output_data(array('goods_list' => $goods_list), mobile_page($page_count));
 }
Exemplo n.º 24
0
 public function getDcListOp($param)
 {
     error_reporting(0);
     $post = $this->read_json();
     $arr = OTA($post);
     $_REQUEST = array_merge($_REQUEST, $arr);
     //var_dump($_REQUEST);
     $model_store = Model('store');
     //var_dump($_REQUEST['param'][0]);
     //$model_store=  Model('seller');
     $storeList = $model_store->getDcStoreOnlineIdArray($post->conditions, $_REQUEST['pageCount'], $post->sortType);
     $storeListBasic = $model_store->getDcInfoBasic($storeList);
     $count = $model_store->gettotalpage();
     //            var_dump($count);
     //            exit();
     $storeListBasic = array_values($storeListBasic);
     if ($count > 0) {
         output_data(array('storeBasic_list' => $storeListBasic), mobile_page($count));
         // output_data($storeList,array('statuCode'=>array('10200'),'total'=>$count));
     } else {
         output_error('10404');
     }
 }
Exemplo n.º 25
0
 /**
  * 兑换信息列表
  */
 public function scoreOrdersOp()
 {
     //兑换信息列表
     $where = array();
     $where['point_buyerid'] = $this->member_info['member_id'];
     $model_pointorder = Model('pointorder');
     $order_list = $model_pointorder->getPointOrderList($where, '*', 10, 0, 'point_orderid desc');
     $pageCount = $model_pointorder->gettotalpage();
     $order_idarr = array();
     $order_listnew = array();
     if (is_array($order_list) && count($order_list) > 0) {
         foreach ($order_list as $k => $v) {
             $order_listnew[$v['point_orderid']] = $v;
             $order_idarr[] = $v['point_orderid'];
         }
     }
     //查询兑换商品
     if (is_array($order_idarr) && count($order_idarr) > 0) {
         $prod_list = $model_pointorder->getPointOrderGoodsList(array('point_orderid' => array('in', $order_idarr)));
         if (is_array($prod_list) && count($prod_list) > 0) {
             foreach ($prod_list as $v) {
                 if (isset($order_listnew[$v['point_orderid']])) {
                     $order_listnew[$v['point_orderid']]['prodlist'][] = $v;
                 }
             }
         }
     }
     output_data(array("score_orders" => $order_listnew), mobile_page($pageCount));
 }
Exemplo n.º 26
0
 /**
  * 用户的回帖
  */
 public function userAnswersOp()
 {
     // 回复列表
     $where = array();
     $types = array(5, 6);
     $model = new Model();
     $m_reply = $model->table('circle_threply');
     $where['circle_threply.member_id'] = $this->member_id;
     $where['circle_theme.thclass_id'] = array('not in', $types);
     $reply_info = $model->table('circle_threply,circle_theme')->join('right join')->on('circle_threply.theme_id=circle_theme.theme_id')->where($where)->page($this->page)->order('reply_addtime desc')->select();
     $pageCount = $m_reply->gettotalpage();
     if (!empty($reply_info)) {
         foreach ($reply_info as $key => $val) {
             $reply_info[$key]['member_avatar'] = getMemberAvatarForID($reply_info[$key]['member_id']);
         }
     }
     output_data(array('answers' => $reply_info), mobile_page($pageCount));
 }
Exemplo n.º 27
0
 public function myOrdersOp()
 {
     $model = new Model();
     $mod_order = $model->table('service_yuyue');
     $where = array();
     $where['service_yuyue.yuyue_member_id'] = $this->member_id;
     $orders = $model->table('service_yuyue,service')->join('right join')->on('service_yuyue.yuyue_service_id=service.service_id')->where($where)->page($this->page)->order('yuyue_time desc')->select();
     $pageCount = $mod_order->gettotalpage();
     output_data(array('yuyues' => $orders), mobile_page($pageCount));
 }
Exemplo n.º 28
0
 /**
  * 积分日志列表
  */
 public function points_logOp()
 {
     $condition_arr = array();
     $condition_arr['pl_memberid'] = $this->member_id;
     //查询积分日志列表
     $points_model = Model('points2');
     $list_log = $points_model->getPointsLogList($condition_arr, $this->page);
     $pageCount = $points_model->gettotalpage();
     //信息输出
     output_data(array('points_log' => $list_log), mobile_page($pageCount));
 }
Exemplo n.º 29
0
 /**
  * 聊天记录查询
  *
  */
 public function get_chat_logOp()
 {
     $member_id = $this->member_info['member_id'];
     $t_id = intval($_POST['t_id']);
     $add_time_to = date("Y-m-d");
     $time_from = array();
     $time_from['7'] = strtotime($add_time_to) - 60 * 60 * 24 * 7;
     $time_from['15'] = strtotime($add_time_to) - 60 * 60 * 24 * 15;
     $time_from['30'] = strtotime($add_time_to) - 60 * 60 * 24 * 30;
     $key = $_POST['t'];
     if (trim($key) != '' && array_key_exists($key, $time_from)) {
         $model_chat = Model('web_chat');
         $list = array();
         $condition_sql = " add_time >= '" . $time_from[$key] . "' ";
         $condition_sql .= " and ((f_id = '" . $member_id . "' and t_id = '" . $t_id . "') or (f_id = '" . $t_id . "' and t_id = '" . $member_id . "'))";
         $list = $model_chat->getLogList($condition_sql, $this->page);
         $total_page = $model_chat->gettotalpage();
         output_data(array('list' => $list), mobile_page($total_page));
     }
 }
Exemplo n.º 30
0
 /**
  * 全部商品
  */
 public function goods_allOp()
 {
     $condition = array();
     $condition['store_id'] = $this->store_info['store_id'];
     if (trim($_GET['inkeyword']) != '') {
         $condition['goods_name'] = array('like', '%' . trim($_GET['inkeyword']) . '%');
     }
     // 排序
     $order = $_GET['order'] == 1 ? 'asc' : 'desc';
     switch (trim($_GET['key'])) {
         case '1':
             $order = 'goods_id ' . $order;
             break;
         case '2':
             $order = 'goods_promotion_price ' . $order;
             break;
         case '3':
             $order = 'goods_salenum ' . $order;
             break;
         case '4':
             $order = 'goods_click ' . $order;
             break;
         default:
             $order = 'goods_id desc';
             break;
     }
     //查询分类下的子分类
     if (intval($_GET['stc_id']) > 0) {
         $condition['goods_stcids'] = array('like', '%,' . intval($_GET['stc_id']) . ',%');
     }
     $model_goods = Model('goods');
     $fieldstr = "goods_id,goods_commonid,goods_name,goods_jingle,store_id,store_name,goods_price,goods_promotion_price,goods_marketprice,goods_storage,goods_image,goods_freight,goods_salenum,color_id,evaluation_good_star,evaluation_count,goods_promotion_type";
     $fieldstr .= ',is_virtual,is_presell,is_fcode,have_gift';
     $recommended_goods_list = $model_goods->getGoodsListByColorDistinct($condition, $fieldstr, $order, 10);
     $page_count = $model_goods->gettotalpage();
     $recommended_goods_list = $this->getGoodsMore($recommended_goods_list);
     $show_store['recommended_goods_list'] = $recommended_goods_list[1];
     //输出分页
     $stc_class = Model('store_goods_class');
     $stc_info = $stc_class->getStoreGoodsClassInfo(array('stc_id' => intval($_GET['stc_id'])));
     $show_store['stc_name'] = $stc_info['stc_name'];
     $goods_list = $this->_goods_list_extend($recommended_goods_list[1]);
     $store_name = $this->store_detail($condition['store_id']);
     output_data(array('goods_list' => $goods_list, 'store_name' => $store_name), mobile_page($page_count));
 }