This commit is contained in:
wangjinlei
2023-05-08 14:00:37 +08:00
parent d9658b40d6
commit 3e1b0e7992
2 changed files with 37 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ class Base extends Controller
protected $production_article_frag_obj = '';
protected $production_article_main_obj = '';
protected $apply_reviewer_obj = '';
protected $promotion_obj = '';
public function __construct(\think\Request $request = null)
@@ -127,6 +128,7 @@ class Base extends Controller
$this->production_article_frag_obj = Db::name('production_article_frag');
$this->production_article_main_obj = Db::name('production_article_main');
$this->apply_reviewer_obj = Db::name("apply_reviewer");
$this->promotion_obj = Db::name("promotion");
}

View File

@@ -0,0 +1,35 @@
<?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);
}
}