| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace app\common\model;
- use think\Model;
- class ProductBuying extends Model
- {
- protected $name = "product_buying";
- //1 正常 2 已出售 0 关闭
- const Normal = 1;
- const SaleOut = 2;
- const Close = 0;
- /*
- * 订单状态
- */
- public $aciton_name = [
- '-1' => '全部',
- self::Normal => '正常',
- self::SaleOut => '已出售',
- self::Close => '关闭',
- ];
- public static function getProductBuyingMaxPrice(int $productId)
- {
- return self::where('product_id', $productId)->max('min_price');
- }
- }
|