|
|
@@ -130,8 +130,9 @@ class GoodsService extends BaseService
|
|
|
}
|
|
|
$list = $this->model->from('trade as a')
|
|
|
->leftJoin('member as b', 'b.id', '=', 'a.user_id')
|
|
|
- ->leftJoin('shop as c', 'c.id', '=', 'a.shop_id')
|
|
|
- ->leftJoin('goods as d', 'd.id', '=', 'a.goods_id')
|
|
|
+ ->leftJoin('member as c', 'c.id', '=', 'a.sell_uid')
|
|
|
+ ->leftJoin('shop as d', 'c.id', '=', 'd.shop_id')
|
|
|
+ ->leftJoin('goods as g', 'g.id', '=', 'a.goods_id')
|
|
|
->where($where)
|
|
|
->where(function ($query) use($params){
|
|
|
$keyword = isset($params['keyword'])? $params['keyword'] : '';
|
|
|
@@ -139,7 +140,7 @@ class GoodsService extends BaseService
|
|
|
$query->orWhere('b.nickname','like',"%{$keyword}%")->orWhere('b.mobile','like',"%{$keyword}%");
|
|
|
}
|
|
|
})
|
|
|
- ->select(['a.*','b.nickname','b.mobile as mobile','c.name as shop_name','d.goods_name','d.thumb','d.code'])
|
|
|
+ ->select(['a.*','b.nickname','b.mobile as mobile','c.nickname as sell_nickname', 'c.mobile as sell_mobile','d.name as shop_name','g.goods_name','g.thumb','g.code'])
|
|
|
->orderBy('a.id','desc')
|
|
|
->paginate($pageSize > 0 ? $pageSize : 9999999);
|
|
|
$list = $list? $list->toArray() :[];
|