Cert.php 782 B

123456789101112131415161718192021222324252627282930
  1. <?php namespace Api\Lib;
  2. use Dever;
  3. class Cert
  4. {
  5. # 获取证书列表
  6. public function list($platform_id)
  7. {
  8. return Dever::db("api/platform_cert")->select(["platform_id" => $platform_id]);
  9. }
  10. # 获取加密列表
  11. public function getEncrypt($platform_id)
  12. {
  13. $encrypt = [
  14. -1 => '无需加密',
  15. -2 => 'md5',
  16. -3 => 'sha256',
  17. -4 => 'sha1',
  18. ];
  19. if ($platform_id) {
  20. $info = Dever::db('api/platform_ssl')->select(['platform_id' => $platform_id]);
  21. if ($info) {
  22. foreach ($info as $k => $v) {
  23. $encrypt[$v['id']] = $v['name'];
  24. }
  25. }
  26. }
  27. return $encrypt;
  28. }
  29. }