Document.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\api\controller;
  3. /**
  4. * ============================================================================
  5. *
  6. * ============================================================================
  7. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  8. * 网站地址: https://www.valimart.net/
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 平台协议控制器
  13. */
  14. class Document extends MobileMall
  15. {
  16. public function initialize()
  17. {
  18. parent::initialize();
  19. }
  20. /**
  21. * @api {POST} api/Document/agreement 用户协议
  22. * @apiVersion 1.0.0
  23. * @apiGroup Document
  24. *
  25. * @apiParam {String} type 协议类型 agreement 用户协议
  26. *
  27. * @apiSuccess {String} code 返回码,10000为成功
  28. * @apiSuccess {String} message 返回消息
  29. * @apiSuccess {Object} result 返回数据
  30. * @apiSuccess {Int} result.document_id 协议ID
  31. * @apiSuccess {Object} result.document_code 协议代码
  32. * @apiSuccess {Object} result.document_title 协议标题
  33. * @apiSuccess {Object} result.document_content 协议内容
  34. * @apiSuccess {Int} result.document_time 添加时间
  35. */
  36. public function agreement() {
  37. $type=input('param.type');
  38. if(!$type){
  39. $type='agreement';
  40. }
  41. $doc = model('document')->getOneDocumentByCode($type);
  42. $doc['document_content']= htmlspecialchars_decode($doc['document_content']);
  43. ds_json_encode(10000, '',$doc);
  44. }
  45. }