Merge branch 'feature/trippest'

mobile-first
lyt 7 years ago
commit 726b7d0ae9

@ -36,11 +36,24 @@ class Vendor_money extends CI_Controller {
}
$vendors = $this->input->post("vendors");
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
// 不同地接社但是拼团号相同
$actual_vendor_duplicate_combineno = $this->money_model->get_duplicate_vei_combineno($start_date, $end_date, implode(",", $vendors));
$duplicate_coli_sn = array_column($actual_vendor_duplicate_combineno, 'COLI_SN');
if ($download_vendor !== null) {
$vendors = array($download_vendor);
$sourcetype = $vendor_sourcetype[strval($download_vendor)]["sourcetype"];
$vendor_name = $vendor_sourcetype[strval($download_vendor)]["vendor_name"];
$vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors));
$vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors), implode(',', $duplicate_coli_sn));
foreach ($actual_vendor_duplicate_combineno as $kad => $vad) {
if ($vad['vendor1'] == $download_vendor) {
$tmp['haina_income'] = $vad['trippest_sum'];
$tmp['vendor_income'] = $vad['vendor_sum'];
$tmp['GRI_No'] = $vad['gri_no'];
$tmp['group_vendor_cost'] = $vad['pure_cost'];
$vendor_data[] = $tmp;
$tmp = array();
}
}
$file_name = str_replace(" ", "_", $date_range) . "_" . $vendor_name;
return $this->download_output($vendor_data, $file_name);
}
@ -91,9 +104,6 @@ class Vendor_money extends CI_Controller {
)
)
);
// 不同地接社但是拼团号相同
$actual_vendor_duplicate_combineno = $this->money_model->get_duplicate_vei_combineno($start_date, $end_date, implode(",", $vendors));
$duplicate_coli_sn = array_column($actual_vendor_duplicate_combineno, 'COLI_SN');
$result['trippest_order_multi_city'] = array_merge($result['trippest_order_multi_city'], $this->money_model->trippest_order_multi_city($start_date, $end_date, implode(',', $vendors)));
$result['trippest_order_cost_debug'] = $this->money_model->cost_debug_detail($start_date, $end_date, implode(',', $vendors));
/**

@ -271,13 +271,13 @@ class OrderFinance_model extends CI_Model {
$tourBz_tmp = "";
if ($this->report_tour_exists($vrt['ordernumber'], $vrt['RPT_COLD_SN']) === TRUE) {
$where = " ordernumber='" . $vrt['ordernumber'] . "' and RPT_COLD_SN=".$vrt['RPT_COLD_SN'] ; //AND tourCode='" . $vrt['tourCode'] . "' ";
// $tourBz_tmp = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($vrt['tourBZ'], ",", true));
// if (stripos($tourBz_tmp, "pvt") === false) {
// $tourBz_tmp = str_replace("]", "", $tourBz_tmp);
// }
// $tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp);
// $where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%'
// OR tourBZ='') ";
$tourBz_tmp = mb_ereg_replace('[^a-zA-Z0-9\-\[\]]$', '', strstr($vrt['tourBZ'], ",", true));
if (stripos($tourBz_tmp, "pvt") === false) {
$tourBz_tmp = str_replace("]", "", $tourBz_tmp);
}
$tourBz_tmp = str_replace("[", "[[]", $tourBz_tmp);
$where .= " AND (tourBZ like '%" . $this->HT->escape_like_str($tourBz_tmp) . "%'
OR tourBZ='') ";
$delete_sql = "DELETE FROM tourmanager.dbo.Report_Tour where " . $where;
// $update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', $vrt, $where);
$this->HT->query($delete_sql);
@ -391,7 +391,7 @@ class OrderFinance_model extends CI_Model {
foreach ($other_tour_cost as $kotc => $votc) {
if ($this->report_tour_exists($votc->ordernumber, $votc->RPT_COLD_SN) === TRUE) {
$where = " ordernumber='" . $votc->ordernumber . "' AND RPT_COLD_SN=" . $votc->RPT_COLD_SN;
// $where .= " AND tourBZ='" . $votc->tourBZ . "' ";
$where .= " AND tourBZ='" . $votc->tourBZ . "' ";
$update_sql = $this->HT->update_string('tourmanager.dbo.Report_Tour', json_decode(json_encode($votc), TRUE), $where);
$this->HT->query($update_sql);
} else {

@ -229,7 +229,7 @@ class Vendor_money_model extends CI_Model {
return $query->result_array();
}
public function group_detail_list($vendor, $sourcetype, $start_date, $end_date, $all_vendor)
public function group_detail_list($vendor, $sourcetype, $start_date, $end_date, $all_vendor, $duplicate_gri)
{
$sql = "SELECT
(dbo.ConvertToRMB('USD',other_vendor_price)) as other_vendorprice_RMB,
@ -295,6 +295,7 @@ class Vendor_money_model extends CI_Model {
)
and CGI_Checked=1
and GRI_OrderType=227002
and COLI_SN not in ($duplicate_gri)
and exists (
select 1 from BIZ_ConfirmLineDetail where COLD_COLI_SN=coli.COLI_SN
and DeleteFlag=0
@ -530,6 +531,7 @@ class Vendor_money_model extends CI_Model {
inner join BIZ_ConfirmLineInfo c on COLI_GRI_SN=GCI_GRI_SN
where g1.gci_combineno=vendor_group.GCI_combineNo
) as COLI_SN
,(select top 1 GRI_No from groupInfo inner join groupcombineinfo gc on gc.GCI_GRI_SN=GRI_SN where gc.gci_combineno=vendor_group.GCI_combineNo) as gri_no
,(SELECT isnull(SUM(CONVERT(float, isnull(gcod.GCOD_sumMoney,0))),0)
FROM GroupCombineOperationDetail gcod
WHERE gcod.GCOD_GCI_combineNo=GCI_combineNo

Loading…
Cancel
Save