chore: 优化系统功能与界面体验
- 升级系统版本至1.0.100 - 新增订单详情页物流、资质等信息展示 - 优化师傅报价页收益计算与显示 - 新增企业资质管理模块 - 优化后台标签页管理与交互 - 修复标签解析与地址脱敏问题 - 优化预约时段选择逻辑 - 调整服务类型配置界面布局
这个提交包含在:
@@ -836,6 +836,8 @@ class Home extends Base
|
||||
|
||||
// 支持多商品组合与增项计算(一口价模式下强制从 fa_service 与 fa_service_spec 读取真实价格,严禁采信前端传入 base_price)
|
||||
$base = 0;
|
||||
$goodsAmount = 0.0;
|
||||
$addonAmount = 0.0;
|
||||
$pricedLines = [];
|
||||
$dictionary = null;
|
||||
if (!empty($goodsList) && is_array($goodsList)) {
|
||||
@@ -869,7 +871,13 @@ class Home extends Base
|
||||
$dictionary = $dictionary ?? ProductPricing::dictionary();
|
||||
$line = self::configuredLine($dbSvc, $config, $dictionary, $g, $isFixedLike);
|
||||
$pricedLines[$index] = $line;
|
||||
$base += $line['total_cents'] / 100;
|
||||
$lineTotal = $line['total_cents'] / 100;
|
||||
$itemNum = max(1, (int)($g['num'] ?? $g['goods_num'] ?? 1));
|
||||
$lineGoods = $isFixedLike ? round(((float)($line['base_price'] ?? 0)) * $itemNum, 2) : 0.0;
|
||||
$lineAddon = $isFixedLike ? max(0.0, round($lineTotal - $lineGoods, 2)) : 0.0;
|
||||
$goodsAmount += $lineGoods;
|
||||
$addonAmount += $lineAddon;
|
||||
$base += $lineTotal;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -973,7 +981,9 @@ class Home extends Base
|
||||
}
|
||||
|
||||
$itemNum = isset($g['num']) ? max(1, (int)$g['num']) : (isset($g['goods_num']) ? max(1, (int)$g['goods_num']) : 1);
|
||||
$base += round($itemPrice * $itemNum, 2);
|
||||
$lineGoods = round($itemPrice * $itemNum, 2);
|
||||
$goodsAmount += $lineGoods;
|
||||
$base += $lineGoods;
|
||||
$curAddonsList = !empty($g['extras']) && is_array($g['extras'])
|
||||
? $g['extras']
|
||||
: (!empty($g['addons']) && is_array($g['addons']) ? $g['addons'] : []);
|
||||
@@ -993,13 +1003,18 @@ class Home extends Base
|
||||
} elseif (!$isFixedLike && isset($ex['price'])) {
|
||||
$exPrice = max(0, (float)$ex['price']);
|
||||
}
|
||||
$base += round($exPrice * $exNum, 2);
|
||||
$lineAddon = round($exPrice * $exNum, 2);
|
||||
$addonAmount += $lineAddon;
|
||||
$base += $lineAddon;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($service && ($config = ProductPricing::read($service))) {
|
||||
$pricedLines[0] = self::configuredLine($service, $config, ProductPricing::dictionary(), $params, $isFixedLike);
|
||||
$base = $pricedLines[0]['total_cents'] / 100;
|
||||
$itemNum = max(1, (int)($params['goods_num'] ?? 1));
|
||||
$goodsAmount = $isFixedLike ? round(((float)($pricedLines[0]['base_price'] ?? 0)) * $itemNum, 2) : 0.0;
|
||||
$addonAmount = $isFixedLike ? max(0.0, round($base - $goodsAmount, 2)) : 0.0;
|
||||
} elseif ($service) {
|
||||
if ($isFixedLike && $service['price_type'] === 'quote') {
|
||||
throw new \InvalidArgumentException('该服务项目不支持一口价模式,请切换为师傅报价或自主定价');
|
||||
@@ -1055,7 +1070,8 @@ class Home extends Base
|
||||
throw new \InvalidArgumentException('该服务项目暂未配置有效一口价,请切换为师傅报价或自主定价');
|
||||
}
|
||||
$goodsNum = isset($params['goods_num']) ? max(1, (int)$params['goods_num']) : 1;
|
||||
$base = round($unitPrice * $goodsNum, 2);
|
||||
$goodsAmount = round($unitPrice * $goodsNum, 2);
|
||||
$base = $goodsAmount;
|
||||
|
||||
$singleAddons = !empty($params['extras']) && is_array($params['extras'])
|
||||
? $params['extras']
|
||||
@@ -1094,7 +1110,9 @@ class Home extends Base
|
||||
} elseif (!$isFixedLike && isset($ex['price'])) {
|
||||
$exPrice = max(0, (float)$ex['price']);
|
||||
}
|
||||
$base += round($exPrice * $exNum, 2);
|
||||
$lineAddon = round($exPrice * $exNum, 2);
|
||||
$addonAmount += $lineAddon;
|
||||
$base += $lineAddon;
|
||||
}
|
||||
}
|
||||
} elseif ($isFixedLike && (!empty($params['is_custom']) || $isStrict || (isset($params['base_price']) && (float)$params['base_price'] > 0))) {
|
||||
@@ -1107,9 +1125,13 @@ class Home extends Base
|
||||
if ($type === 'custom') {
|
||||
// 用户自主定价:出价即订单总价,已包含楼层费/加急费,师傅按此价接单
|
||||
$base = max(0, round((float)$userPrice, 2));
|
||||
$goodsAmount = $base;
|
||||
$addonAmount = 0.0;
|
||||
$total = $base;
|
||||
} elseif ($type === 'quote') {
|
||||
// 师傅报价模式:金额由师傅后续竞价给出,下单时总价与应付为 0
|
||||
$goodsAmount = 0.0;
|
||||
$addonAmount = 0.0;
|
||||
$total = 0;
|
||||
$floorAmount = 0;
|
||||
$urgentAmount = 0;
|
||||
@@ -1148,6 +1170,8 @@ class Home extends Base
|
||||
'lines' => $pricedLines,
|
||||
'price_type' => $type,
|
||||
'user_price' => $type === 'custom' ? round($base, 2) : 0,
|
||||
'goods_amount' => $type === 'quote' ? 0 : round($goodsAmount, 2),
|
||||
'addon_amount' => $type === 'quote' ? 0 : round($addonAmount, 2),
|
||||
'base_amount' => $type === 'quote' ? 0 : round($base, 2),
|
||||
'floor_amount' => round($floorAmount, 2),
|
||||
'urgent_amount' => round($urgentAmount, 2),
|
||||
|
||||
@@ -832,7 +832,10 @@ class Master extends MasterBase
|
||||
}
|
||||
|
||||
$rawAddr = (string)$row['address'];
|
||||
$maskedAddr = preg_replace('/\d+栋|\d+单元|\d+室|\d+号楼/', '**', $rawAddr);
|
||||
$maskedAddr = preg_replace('/\d+号.*|\d+栋.*|\d+单元.*|\d+室.*|\d+楼.*/u', '******', $rawAddr);
|
||||
if ($maskedAddr === $rawAddr && mb_strlen($rawAddr) > 6) {
|
||||
$maskedAddr = mb_substr($rawAddr, 0, mb_strlen($rawAddr) - 4) . '****';
|
||||
}
|
||||
$prefix = trim($row['city'] . $row['district']);
|
||||
if ($prefix !== '' && strpos($maskedAddr, $row['district']) === false && strpos($maskedAddr, $row['city']) === false) {
|
||||
$row['address'] = $prefix . $maskedAddr;
|
||||
@@ -1853,7 +1856,7 @@ class Master extends MasterBase
|
||||
}
|
||||
$list = Db::name('order_quote')->alias('q')
|
||||
->join('order o', 'o.id = q.order_id', 'LEFT')
|
||||
->field('q.*, o.order_no, o.service_name, o.pay_amount as order_amount, o.status as order_status')
|
||||
->field('q.*, o.order_no, o.service_name, o.pay_amount as order_amount, o.status as order_status, o.price_type, o.cat_id, o.urgent, o.commission_rate, o.commission_snapshot')
|
||||
->where('q.master_id', $master['id'])
|
||||
->order('q.id desc')
|
||||
->limit(30)
|
||||
@@ -1862,6 +1865,15 @@ class Master extends MasterBase
|
||||
foreach ($list as &$row) {
|
||||
$row['status_text'] = isset($statusText[$row['status']]) ? $statusText[$row['status']] : $row['status'];
|
||||
$row['amount'] = (float)$row['amount'];
|
||||
$qCalc = CommissionService::calcByOrder([
|
||||
'price_type' => $row['price_type'] ?: 'quote',
|
||||
'cat_id' => (int)($row['cat_id'] ?? 0),
|
||||
'urgent' => (int)($row['urgent'] ?? 0),
|
||||
'commission_rate' => $row['commission_rate'] ?? null,
|
||||
'commission_snapshot' => $row['commission_snapshot'] ?? '',
|
||||
], $row['amount']);
|
||||
$row['master_fee'] = (float)$qCalc['settle_amount'];
|
||||
unset($row['commission_rate'], $row['commission_snapshot']);
|
||||
$row['time_text'] = date('m-d H:i', (int)$row['createtime']);
|
||||
$row['expire_text'] = date('m-d H:i', (int)$row['expire_time']);
|
||||
}
|
||||
@@ -2477,6 +2489,7 @@ class Master extends MasterBase
|
||||
'my_quote' => $myQuote ? [
|
||||
'id' => (int)$myQuote['id'],
|
||||
'amount' => (float)$myQuote['amount'],
|
||||
'master_fee' => (float)CommissionService::calcByOrder($order, (float)$myQuote['amount'])['settle_amount'],
|
||||
'description' => $myQuote['description'],
|
||||
'status' => $myQuote['status'],
|
||||
] : null,
|
||||
|
||||
在新工单中引用
屏蔽一个用户