调整身份相关

This commit is contained in:
2023-03-10 17:53:02 +08:00
parent 3cd75b1d6e
commit 2bf6a397b1
10 changed files with 86 additions and 13 deletions

View File

@@ -31,8 +31,8 @@ class Goods extends Model
const TYPE_SINGLE = 1;
const TYPE_MULTIPLE = 2;
const TYPE_MAP = [
self::TYPE_SINGLE => '单规格',
// self::TYPE_MULTIPLE => '多规格',
self::TYPE_SINGLE => '单规格',
self::TYPE_MULTIPLE => '多规格',
];
/**
* 状态

View File

@@ -59,4 +59,25 @@ class GoodsSku extends Model
return false;
}
/**
* @Notes : 检测商品价格,给出最低售价
*
* @Date : 2022/6/30 11:41
* @param float $cost
* @param float $price
* @return float
* @author : Mr.wang
*/
public static function verifyPrice(float $cost, float $price): float
{
return 0;
$costPercent = app('Conf_mall')['cost_percent'] ?? 70;
$up = ceil(bcdiv($cost, bcdiv($costPercent, 100, 4), 2));
if ($price < $up) {
return $up;
} else {
return 0;
}
}
}