20240120-ljl-routeConfig
ljl 10 months ago
parent 6775907169
commit ddd3e2091d

@ -44,7 +44,7 @@ class OpSysExpressTplDao extends AbstractDao {
if ($sort) {
$orderByArr[] = 'ol.sort '. $sort;
$orderByArr[] = 'oset.waybill_type '. $sort;
$joinTableStr = $this->prepare('left join %b ol on ol.cp_code = oset.cp_code', $logisticsTbl);
$joinTableStr = $this->prepare('left join %b ol on ol.logistics_id = oset.logistics_id', $logisticsTbl);
}
$orderByArr[] = 'oset.op_sys_express_tpl_id desc';
$sql = 'select oset.* from %b oset %l where oset.`status` = %s %l order by %l';

@ -6,6 +6,7 @@ use AppConst;
use CheckClient;
use ZcArrayHelper;
use CommonTool;
use Dao\Common\LogisticsDao;
use Dao\Common\LogisticsPlatformDao;
use Dao\OrderPrint\OpSysExpressTplDao;
use DbTool;
@ -40,6 +41,7 @@ class ExpressTplService extends AbstractService {
private $mallSDao;
private $mallAppSDao;
private $logisticsDao;
private $logisticsPlatformDao;
private $opVenderExpressTplDao;
private $opSysExpressTplDao;
@ -57,6 +59,7 @@ class ExpressTplService extends AbstractService {
$this->mallSDao = MallSDao::instance();
$this->mallAppSDao = MallAppSDao::instance();
$this->logisticsDao = LogisticsDao::instance();
$this->logisticsPlatformDao = LogisticsPlatformDao::instance();
$this->opUserExpressTplDao = OpUserExpressTplDao::instance();
$this->opUserExpressTplAuthDao = OpUserExpressTplAuthDao::instance();
@ -491,29 +494,28 @@ class ExpressTplService extends AbstractService {
}
public function getNormalSysExpressTplMap($expressType, $waybillTypes = null, $sort = null, $allColumns = false) {
$logisticsMap = LogisticsConst::getLogisticsMap();
$logisticsMap = $this->logisticsDao->getLogisticsMap();
$tplList = $this->opSysExpressTplDao->searchNormalTplList($expressType, $waybillTypes, $sort);
$columns = ['opSysExpressTplId','cpCode','tplName','tplImgUrl', 'waybillType', 'expressType', 'isChildParent'];
$columns = ['opSysExpressTplId','logisticsId','tplName','tplImgUrl', 'waybillType', 'expressType', 'isChildParent'];
$groupTpls = [];
foreach ($tplList as $key => $tpl) {
if (empty($logisticsMap[$tpl['cpCode']])) {
if (empty($logisticsMap[$tpl['logisticsId']])) {
continue;
}
if (!$allColumns) {
$tpl = ZcArrayHelper::filterColumns($tpl, $columns);
}
$tpl['logisticsName'] = $logisticsMap[$tpl['cpCode']];
$tpl['logisticsName'] = $logisticsMap[$tpl['logisticsId']];
$tpl['tplImgUrl'] = OrderPrintTool::opPubAbsUrl( $tpl['tplImgUrl']);
if (empty($groupTpls[$tpl['cpCode']])) {
$groupTpls[$tpl['cpCode']] = [
'cpCode' => $tpl['cpCode'],
'logisticsName' => $logisticsMap[$tpl['cpCode']],
if (empty($groupTpls[$tpl['logisticsId']])) {
$groupTpls[$tpl['logisticsId']] = [
'logisticsName' => $logisticsMap[$tpl['logisticsId']],
'tpls' => [$tpl]
];
} else {
$groupTpls[$tpl['cpCode']]['tpls'][] = $tpl;
$groupTpls[$tpl['logisticsId']]['tpls'][] = $tpl;
}
}
return array_values($groupTpls);

Loading…
Cancel
Save