WqVersionLog.php 751 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: blank
  5. * Date: 2020/4/30
  6. * Time: 9:19
  7. */
  8. namespace app\common\models;
  9. class WqVersionLog extends BaseModel
  10. {
  11. protected $table = 'yz_wq_version_log';
  12. protected $guarded = [];
  13. protected $attributes = [];
  14. /**
  15. * 保存版本号
  16. * @param $version
  17. * @return static
  18. */
  19. static public function createLog($version)
  20. {
  21. return self::create(['version' => $version]);
  22. }
  23. /**
  24. * 是否存在
  25. * @param $version string 版本号
  26. * @return bool false:不存在 true:存在
  27. */
  28. static public function verifyExist($version)
  29. {
  30. $log = self::where('version', $version)->first();
  31. return is_null($log)?false:true;
  32. }
  33. }