BookConstants.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Bear
  5. * Date: 2018/12/22
  6. * Time: 下午6:27
  7. */
  8. namespace app\main\constants;
  9. use think\Config;
  10. class BookConstants
  11. {
  12. const BOOK_STATE_ON_SALE = '1';//上架
  13. const BOOK_STATE_OFF_SALE = '0';//下架
  14. const BOOK_STATE_IN_STORAGE = '-1';//入库
  15. const BOOK_IS_FINISH_YES = '1';//完本
  16. const BOOK_IS_FINISH_NO = '0';//连载
  17. const BOOK_CANSEE_YES = '1';//可见
  18. const BOOK_CANSEE_NO = '0';//不可见
  19. const BOOK_BILLING_MODEL_BOOK = 2; //按本收费
  20. const BOOK_BILLING_MODEL_CHAPTER = 1; //按章收费
  21. #region 书架
  22. const SHELF_INSERT_TYPE_RECOMMEND = 1;//用户注册,系统推荐书籍加入书架
  23. const SHELF_INSERT_TYPE_AUTO = 2;//阅读到第10章自动加入书架。
  24. const SHELF_INSERT_TYPE_MANUAL = 3;//用户手动加入书架。
  25. #endregion
  26. #region 推荐标签
  27. const BOOK_TAGS_PRE = 'BTP:';
  28. #endregion 推荐标签
  29. #分流链接的key
  30. const VIP_REFERRAL_KEY = 'RSI:';
  31. public static $chapter_price = [
  32. 0 => 0, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 60 => 60, 70 => 70, 80 => 80, 90 => 90, 100 => 100,
  33. ];
  34. public static $chapter_charge_start = [
  35. 0, 15, 16, 17, 18, 19, 20,
  36. ];
  37. public static function getBookChapterDir()
  38. {
  39. $path = Config::get('site.chapter_path');
  40. if (empty($path)) {
  41. $path = 'cppartner';
  42. }
  43. return $path;
  44. }
  45. }