|
|
@@ -2,6 +2,7 @@
|
|
|
namespace app\api\lists;
|
|
|
|
|
|
use app\adminapi\lists\BaseAdminDataLists;
|
|
|
+use app\common\model\goods\Goods;
|
|
|
use app\common\model\home_service\HomeSpecial;
|
|
|
use app\common\lists\ListsSearchInterface;
|
|
|
|
|
|
@@ -42,10 +43,15 @@ class HomeSpecialLists extends BaseApiDataLists implements ListsSearchInterface
|
|
|
{
|
|
|
return HomeSpecial::where($this->searchWhere)
|
|
|
->where('status',1)
|
|
|
- ->field(['id', 'special_type','special_way', 'title', 'cover_type', 'cover', 'user_head', 'user_nickname', 'vue_web', 'vue_param', 'view_num', 'tags', 'status', 'original_price' ,'present_price'])
|
|
|
+ ->field(['id', 'special_type','special_way', 'title', 'cover_type', 'cover', 'user_head', 'user_nickname', 'vue_web', 'vue_param', 'view_num', 'tags', 'status', 'original_price' ,'present_price','goods_id'])
|
|
|
->limit($this->limitOffset, $this->limitLength)
|
|
|
->order(['id' => 'desc'])
|
|
|
->select()
|
|
|
+ ->each(function($item){
|
|
|
+ if($item->goods_id){
|
|
|
+ $item->goods = Goods::where('id',$item->goods_id)->field('goods_banners,goods_name,service_total,service_fee')->findOrEmpty();
|
|
|
+ }
|
|
|
+ })
|
|
|
->toArray();
|
|
|
}
|
|
|
|