1
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
||||
35
application/api/controller/Promotion.php
Normal file
35
application/api/controller/Promotion.php
Normal 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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user