1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- namespace app\api\controller;
- use think\facade\Lang;
- class Memberconsult extends MobileMember
- {
- public function initialize()
- {
- parent::initialize();
- Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/sellerconsult.lang.php');
- }
-
- public function index()
- {
- $this->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);
- }
- }
|