my_consult(); } public function my_consult() { //实例化商品咨询模型 $consult_model = model('consult'); $goods_model = model('goods'); $search_array = array(); if (input('param.type') != '') { if (input('param.type') == 'to_reply') { $search_array[] = array('consult_reply', '=', ''); } if (input('param.type') == 'replied') { $search_array[] = array('consult_reply', '<>', ''); } } $search_array[] = array('member_id', '=', $this->member_info['member_id']); $list_consult = $consult_model->getConsultList($search_array); if (!empty($list_consult)) { foreach ($list_consult as $key => $val) { $condition = array(); $condition[] = array('goods_id', '=', $val['goods_id']); $goodsinfo = $goods_model->getGoodsInfo($condition, 'goods_image,goods_price'); $list_consult[$key]['goods_image'] = goods_cthumb($goodsinfo['goods_image']); $list_consult[$key]['goods_price'] = $goodsinfo['goods_price']; } } // 咨询类型 $consult_type = rkcache('consulttype', true); $result = array_merge(array('consult_list' => $list_consult, 'consult_type' => $consult_type), mobile_page($consult_model->page_info)); ds_json_encode(10000, '', $result); } }