|
|
|
@ -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);
|
|
|
|
|