MarketModel.class.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace Common\Model;
  3. class MarketModel extends \Think\Model
  4. {
  5. public function check_install()
  6. {
  7. $this->check_server();
  8. $this->check_authorization();
  9. $this->check_database();
  10. $this->check_update();
  11. $this->check_file();
  12. }
  13. public function check_uninstall()
  14. {
  15. }
  16. public function check_server()
  17. {
  18. }
  19. public function check_authorization()
  20. {
  21. }
  22. public function check_database()
  23. {
  24. }
  25. public function check_update()
  26. {
  27. }
  28. public function check_file()
  29. {
  30. }
  31. public function get_new_price($market = NULL)
  32. {
  33. if (empty($market)) {
  34. return null;
  35. }
  36. $get_new_price = (APP_DEBUG ? null : S('get_new_price_' . $market));
  37. if (!$get_new_price) {
  38. $get_new_price = M('Market')->where(array('name' => $market))->getField('new_price');
  39. S('get_new_price_' . $market, $get_new_price);
  40. }
  41. return $get_new_price;
  42. }
  43. public function get_title($market = NULL)
  44. {
  45. $xnb = explode('_', $market)[0];
  46. $rmb = explode('_', $market)[1];
  47. $xnb_title = D('Coin')->get_title($xnb);
  48. $rmb_title = D('Coin')->get_title($rmb);
  49. return $xnb_title . '/' . $rmb_title;
  50. }
  51. }
  52. ?>