|
@@ -282,12 +282,17 @@ class GoodsLogic
|
|
|
$where['g.is_show'] = 1;
|
|
|
$where['g.id'] = $id;
|
|
|
$field = ['g.*','gc.name goods_category_name','a.name author_name','a.image author_image','n.name network_name','gc.is_convert'];
|
|
|
+ $field[] = 'c.name as buy_goods_name';
|
|
|
+ $field[] = 'b.num as buy_need_num';
|
|
|
+
|
|
|
$goodsData = new Goods();
|
|
|
$data = $goodsData
|
|
|
->alias('g')
|
|
|
->join('author a','a.id = g.author_id')
|
|
|
->join('goods_category gc','gc.id = g.goods_category_id')
|
|
|
->join('network n','n.id = g.network_id')
|
|
|
+ ->join('goods_buy b','g.id=b.goods_id','left')
|
|
|
+ ->join('goods c','c.id=b.source_goods_id','left')
|
|
|
->where($where)
|
|
|
->field($field)
|
|
|
->find();
|
|
@@ -849,4 +854,7 @@ class GoodsLogic
|
|
|
if($result) return Response::success($is_show == 1?'上架成功':'下架成功');
|
|
|
return Response::fail($is_show == 1?'上架失败':'下架失败');
|
|
|
}
|
|
|
+ public function preOrder($id,$uid){
|
|
|
+
|
|
|
+ }
|
|
|
}
|