join('goods_desc gd', 'g.id=gd.goods_id') ->field("g.id,g.supplier_goods_code,g.status,gd.goods_title_cn,gd.goods_title_en,(select url from web_goods_picture where goods_id=g.id order by id asc limit 1) as picture")->where($condition)->order($order)->limit(18)->select()->toArray(); if (!$list) { $list = []; } else { foreach ($list as $key => $value) { $list[$key]['picture'] = get_img_url($value['picture']); } } $result['list'] = $list; return $this->successResponse($result); } catch (Exception $exc) { return $this->errorResponse($exc->getMessage()); } } public function getBigvList() { try { if (!Request::isPost()) { throw new Exception(lang('request_method_incorrect')); } $condition[] = ['BIGV.is_show', '=', 1]; $order = 'BIGV.id asc'; $list = Db::name('seller_bigv_info')->alias('BIGV') ->join('seller_base_info SBI', 'SBI.seller_id=BIGV.seller_id') ->field("BIGV.*,SBI.first_name")->withAttr('personal_images', function ($value) { return json_decode($value, TRUE); })->where($condition)->order($order)->limit(6)->select()->toArray(); if (!$list) { $list = []; } $result['list'] = $list; return $this->successResponse($result); } catch (Exception $exc) { return $this->errorResponse($exc->getMessage()); } } public function getSchoolList() { try { if (!Request::isPost()) { throw new Exception(lang('request_method_incorrect')); } $order = 'order_id asc,id asc'; $list = Db::name('partner_school')->field("*")->order($order)->limit(30)->select()->toArray(); if (!$list) { $list = []; } $result['list'] = $list; return $this->successResponse($result); } catch (Exception $exc) { return $this->errorResponse($exc->getMessage()); } } public function getSalesPlatformList() { try { if (!Request::isPost()) { throw new Exception(lang('request_method_incorrect')); } $condition[] = ['is_show', '=', 1]; $order = 'order_id asc,id asc'; $list = Db::name('sales_platform')->field("*")->where($condition)->order($order)->limit(6)->select()->toArray(); if (!$list) { $list = []; } else{ foreach ($list as $key => $value) { $list[$key]['logo'] = get_img_url($value['logo']); } } $result['list'] = $list; return $this->successResponse($result); } catch (Exception $exc) { return $this->errorResponse($exc->getMessage()); } } }