| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- /**
- * User: Qinii
- * Date: 2020-06-05
- * Time: 09:41
- */
- namespace app\controller\api\article;
- use think\App;
- use app\common\repositories\article\ArticleCategoryRepository as repository;
- use crmeb\basic\BaseController;
- class ArticleCategory extends BaseController
- {
- /**
- * @var repository
- */
- protected $repository;
- protected $merId;
- protected $source;
- /**
- * StoreBrand constructor.
- * @param App $app
- * @param repository $repository
- */
- public function __construct(App $app, repository $repository)
- {
- parent::__construct($app);
- $this->repository = $repository;
- $this->source = $this->request->header('source');
- $this->merId = $this->request->header('merId');
- }
- /**
- * @return mixed
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- * @author Qinii
- */
- public function lst()
- {
- $id = $this->request->param('id') ?? 0;
- $where['status']=1;
- if($this->source=='yhc'){
- $where['mer_id']=$this->merId;
- }else{
- $where['mer_id']=0;
- $where['pid']=$id;
- }
- return app('json')->success($this->repository->apiGetArtcleCategory($where));
- }
- }
|