35 lines
750 B
PHP
35 lines
750 B
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\api\controller\Base;
|
|
use think\Db;
|
|
use think\Queue;
|
|
use think\Validate;
|
|
class Promotion extends Base
|
|
{
|
|
|
|
public function __construct(\think\Request $request = null)
|
|
{
|
|
parent::__construct($request);
|
|
}
|
|
|
|
/**获取推广任务列表
|
|
* @return \think\response\Json|void
|
|
*/
|
|
public function getPromotions(){
|
|
$data = $this->request->post();
|
|
$rule = new Validate([
|
|
'user_id'=>'require'
|
|
]);
|
|
if(!$rule->check($data)){
|
|
return jsonError($rule->getError());
|
|
}
|
|
$list = $this->promotion_obj->where('user_id',$data['user_id'])->select();
|
|
$re['list'] = $list;
|
|
return jsonSuccess($list);
|
|
}
|
|
|
|
|
|
|
|
} |