Commit 475f8aba authored by suntengda's avatar suntengda

update 自提点相关接口

parent 8eae48df
<?php
/**
* Author : Tengda
* Date : 2021/7/29
* Time : 11:12 上午
*/
use App\Base\Base;
use App\Services\marketing\TakePlaceService;
use Validate\TakePlaceValidate;
class TakeplaceController extends Base
{
/**
* 获取自提点列表
* http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=71671761
* @throws \App\Exception\custom\ParamException
*/
public function listAction()
{
(new TakePlaceValidate())->scene('list')->validate();
$keywords = $this->params['keywords'] ?? '';
$offset = $this->params['offset'] ?? 0;
$limit = $this->params['limit'] ?? 20;
$res = TakePlaceService::searchList($keywords,$offset,$limit);
$this->success(['data'=>$res]);
}
/**
* 添加自提点
* http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=71671759
* @throws \App\Exception\custom\ParamException
*/
public function addAction()
{
(new takePlaceValidate())->scene('add')->validate();
$res = TakePlaceService::add($this->params);
$this->success(['status'=>$res ? 'success' : 'failed']);
}
/**
* 删除自提点
* @throws \App\Exception\custom\ParamException
*/
public function deleteAction()
{
(new takePlaceValidate())->scene('delete')->validate();
$res = TakePlaceService::delete($this->params['take_place_id']);
$this->success(['status'=>$res ? 'success' : 'failed']);
}
/**
* 获取活动绑定的自提点列表
* @throws \App\Exception\custom\ParamException
*/
public function get_bind_listAction()
{
(new takePlaceValidate())->scene('bindList')->validate();
$marketingPindanId = $this->params['marketing_pindan_id'];
$offset = $this->params['offset'] ?? 0;
$limit = $this->params['limit'] ?? 20;
$data = TakePlaceService::getPindanTakePlaceList($marketingPindanId,$offset,$limit);
$this->success(['data'=>$data]);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment