master
wangxinglong 2022-01-21 14:38:01 +08:00
parent bafc537b55
commit 1e8e98f998
2 changed files with 20 additions and 0 deletions

View File

@ -174,6 +174,25 @@ class Consumer extends Base
return $this->json(1,"ok",$list["list"]);
}
/**
* 广告列表
* */
public function advertisement()
{
$repo = OperationRepository::getInstance();
$whereMap = [];
$orders = ['sort'=>'asc'];
$page = input("page/d",1);
$size = input("size/d",1000);
$whereMap[] = ['position', '=', Slide::advertisement];
$list = $repo->slideList($whereMap, ["id","title","src as image","url","url_type as type"], $page, $size, function ($q){
return $q->withAttr("image",function ($value){
return $this->request->domain() . $value;
});
}, $orders);
return $this->json(1,"ok",$list["list"]);
}
/**
* 关注/取消关注一个商家

View File

@ -5,6 +5,7 @@ namespace app\model;
class Slide extends Base
{
public const homePosition = "home-banner";
public const advertisement = "advertisement";
public static function delByIds($ids)
{
return self::whereIn('id', $ids)->delete();