feat(commission): 支持计奖商品参与设置、独立分成与多规格规则,完善团队中心与微信快捷登录
这个提交包含在:
@@ -42,7 +42,7 @@ class ScoreSkuPrice extends Common
|
||||
|
||||
|
||||
/**
|
||||
* 积分加现金
|
||||
* 兑换门槛(兑换券 + 积分)
|
||||
*
|
||||
* @param string $value
|
||||
* @param array $data
|
||||
@@ -50,10 +50,19 @@ class ScoreSkuPrice extends Common
|
||||
*/
|
||||
public function getScorePriceAttr($value, $data)
|
||||
{
|
||||
$score = $data['score'] ?? 0;
|
||||
$score = intval($data['score'] ?? 0);
|
||||
$price = $data['price'] ?? 0;
|
||||
$priceNum = floatval($price);
|
||||
|
||||
return $score . '积分' . ($price ? '+¥' . $price : '');
|
||||
if ($priceNum > 0 && $score > 0) {
|
||||
return '¥' . $price . '兑换券 + ' . $score . '积分';
|
||||
} elseif ($priceNum > 0) {
|
||||
return '¥' . $price . ' 兑换券';
|
||||
} elseif ($score > 0) {
|
||||
return $score . '积分';
|
||||
}
|
||||
|
||||
return '免费兑换';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -113,9 +113,24 @@ class User extends Common
|
||||
{
|
||||
$value = array_filter((array)json_decode($value, true));
|
||||
$value = array_merge(['username' => 0, 'password' => 0, 'mobile' => 0], $value);
|
||||
// 若数据库中已有手机号,则自动判定为已绑定/已验证手机号
|
||||
if (!empty($data['mobile'])) {
|
||||
$value['mobile'] = 1;
|
||||
}
|
||||
return (object)$value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置验证字段
|
||||
* @param mixed $value
|
||||
* @return string
|
||||
*/
|
||||
public function setVerificationAttr($value)
|
||||
{
|
||||
$value = is_object($value) || is_array($value) ? json_encode($value) : $value;
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function parentUser()
|
||||
{
|
||||
return $this->hasOne(User::class, 'id', 'parent_user_id')->field(['id', 'avatar', 'nickname', 'gender']);
|
||||
|
||||
在新工单中引用
屏蔽一个用户