42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
<?php
|
|
namespace app\api\controller\v1;
|
|
|
|
use app\api\model\CouponSubscribe as CouponSubscribeModel;
|
|
use app\api\validate\CouponSubscribe as CouponSubscribeValidate;
|
|
|
|
/**
|
|
* 优惠券领用表
|
|
* Class CouponSubscribe
|
|
* @package app\api\controller
|
|
*/
|
|
class CouponSubscribe extends Base
|
|
{
|
|
public function initialize()
|
|
{
|
|
parent::initialize();
|
|
$this->model = new CouponSubscribeModel();
|
|
$this->validate = new CouponSubscribeValidate();
|
|
}
|
|
|
|
/**
|
|
* 列表
|
|
* @return \think\response\Json
|
|
*/
|
|
public function index()
|
|
{
|
|
$inputData = $this->request->param();
|
|
$inputData['platform_id'] = $this->platformId;
|
|
if (isset($inputData['language_id']) && $inputData['language_id'] != 0 && $inputData['language_id'] != '') {
|
|
$this->focus['site_id'] = $inputData['site_id'] = $inputData['language_id'];
|
|
unset($inputData['language_id']);
|
|
}
|
|
if (!$this->commonValidate(__FUNCTION__,$inputData)) {
|
|
return $this->msg(-1,$this->validate->getError());
|
|
}
|
|
$this->orderby = ['create_time'=>'desc'];
|
|
$this->field = ['id','platform_id','site_id','email','phone','create_time'];
|
|
$result = $this->model->getAllList($inputData,$this->simple,$this->focus,$this->orderby,$this->field);
|
|
return $this->msg(200,'获取列表成功',$result);
|
|
}
|
|
}
|