新增amqp队列,新增订单创建
This commit is contained in:
@@ -38,4 +38,28 @@ class ProductPlatformAmount extends Model
|
||||
protected array $casts = ['amount_id' => 'integer', 'product_platform_id' => 'integer', 'real_stock' => 'integer', 'stock' => 'integer', 'lock_stock' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected string $primaryKey = "amount_id";
|
||||
|
||||
/**
|
||||
* 自增
|
||||
* @param array $params
|
||||
* @param string $field
|
||||
* @param float $numeral
|
||||
* @return int
|
||||
*/
|
||||
public static function inc(array $params,string $field,float $numeral = 1): int
|
||||
{
|
||||
return self::where($params)->increment($field,$numeral);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自减
|
||||
* @param array $params
|
||||
* @param string $field
|
||||
* @param float $numeral
|
||||
* @return int
|
||||
*/
|
||||
public static function dec(array $params,string $field,float $numeral = 1): int
|
||||
{
|
||||
return self::where($params)->decrement($field,$numeral);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user