Agreement.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\controller\admin\agreement;
  3. use app\common\repositories\agreement\AgreementRepository;
  4. use crmeb\basic\BaseController;
  5. use app\common\repositories\article\ArticleRepository;
  6. use think\App;
  7. class Agreement extends BaseController
  8. {
  9. /**
  10. * @var AgreementRepository
  11. */
  12. protected $repository;
  13. /**
  14. * Agreement constructor.
  15. * @param AgreementRepository $app
  16. * @param $repository
  17. */
  18. public function __construct(App $app, AgreementRepository $repository)
  19. {
  20. parent::__construct($app);
  21. $this->repository = $repository;
  22. }
  23. /*列表*/
  24. public function lst(){
  25. return app("json")->success($this->repository->getList(1,20));
  26. }
  27. /*详情*/
  28. public function detail($id){
  29. return app("json")->success($this->repository->getDetail($id));
  30. }
  31. /*修改*/
  32. public function update($id){
  33. $data = $this->request->params(['content','title','status']);
  34. return app("json")->success($this->repository->updateData($id,$data));
  35. }
  36. /*详情*/
  37. public function detailContent($id){
  38. return $this->repository->getDetailContent($id);
  39. }
  40. }