ProductBuying.php 638 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class ProductBuying extends Model
  5. {
  6. protected $name = "product_buying";
  7. //1 正常 2 已出售 0 关闭
  8. const Normal = 1;
  9. const SaleOut = 2;
  10. const Close = 0;
  11. /*
  12. * 订单状态
  13. */
  14. public $aciton_name = [
  15. '-1' => '全部',
  16. self::Normal => '正常',
  17. self::SaleOut => '已出售',
  18. self::Close => '关闭',
  19. ];
  20. public static function getProductBuyingMaxPrice(int $productId)
  21. {
  22. return self::where('product_id', $productId)->max('min_price');
  23. }
  24. }