mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-01 15:31:03 +00:00
处理运费模版编辑之后,不送达计算错误的问题
This commit is contained in:
parent
fdaa2156cf
commit
8054569c51
@ -51,9 +51,9 @@ class ShippingTemplatesNoDeliveryDao extends BaseDao
|
||||
* @param string $key
|
||||
* @return array
|
||||
*/
|
||||
public function getShippingArray(array $where, string $field, string $key)
|
||||
public function getShippingArray(array $where)
|
||||
{
|
||||
return $this->search($where)->column($field, $key);
|
||||
return $this->search($where)->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -86,11 +86,9 @@ class ShippingTemplatesNoDeliveryServices extends BaseServices
|
||||
{
|
||||
$freeIdList = $this->dao->getShippingGroupArray(['temp_id' => $tempId], 'uniqid', 'uniqid', '');
|
||||
$freeData = [];
|
||||
$infos = $this->dao->getShippingArray(['uniqid' => $freeIdList, 'temp_id' => $tempId], '*', 'uniqid');
|
||||
foreach ($freeIdList as $uniqid) {
|
||||
$info = $infos[$uniqid];
|
||||
$freeData[] = [
|
||||
'place' => $this->getNoDeliveryTemp($uniqid, $info['province_id']),
|
||||
'place' => $this->getNoDeliveryTemp($uniqid),
|
||||
];
|
||||
}
|
||||
foreach ($freeData as &$item) {
|
||||
@ -102,10 +100,9 @@ class ShippingTemplatesNoDeliveryServices extends BaseServices
|
||||
/**
|
||||
* 获取不送达的省份
|
||||
* @param string $uniqid
|
||||
* @param int $provinceId
|
||||
* @return array
|
||||
*/
|
||||
public function getNoDeliveryTemp(string $uniqid, int $provinceId)
|
||||
public function getNoDeliveryTemp(string $uniqid)
|
||||
{
|
||||
/** @var ShippingTemplatesNoDeliveryCityServices $service */
|
||||
$service = app()->make(ShippingTemplatesNoDeliveryCityServices::class);
|
||||
@ -115,7 +112,7 @@ class ShippingTemplatesNoDeliveryServices extends BaseServices
|
||||
$childrenData[] = [
|
||||
'city_id' => $item['province_id'],
|
||||
'name' => $item['name'] ?? '全国',
|
||||
'children' => $this->getCityTemp($uniqid, $provinceId)
|
||||
'children' => $this->getCityTemp($uniqid, $item['province_id'])
|
||||
];
|
||||
}
|
||||
return $childrenData;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user