Merge branch 'master' of gitee.com:hainatravel/information-system

mobile-first
cyc 6 years ago
commit ffd18182c6

@ -54,8 +54,8 @@ class Sendmail extends CI_Controller
} }
$this->load->library('email'); $this->load->library('email');
$config['protocol'] = 'smtp'; $config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://hwsmtp.exmail.qq.com';//ssl://smtp.sendgrid.net'; $config['smtp_host'] = 'hwsmtp.exmail.qq.com';//ssl://smtp.sendgrid.net';
$config['smtp_port'] = 465; $config['smtp_port'] = 25;
$config['smtp_user'] = 'noreply02@chinahighlights.net';//'zm198311@yahoo.com.cn'; $config['smtp_user'] = 'noreply02@chinahighlights.net';//'zm198311@yahoo.com.cn';
$config['smtp_pass'] = 'eHgb2Z8G\HbR';//cits@123'; $config['smtp_pass'] = 'eHgb2Z8G\HbR';//cits@123';
$config['smtp_timeout'] = 3600; $config['smtp_timeout'] = 3600;

@ -327,6 +327,18 @@ class TulanduoApi extends CI_Controller
$getInfo_byGroupCode = $getInfo_byGroupCodeArr[0]; // 渠道和目的地有重复操作的团 $getInfo_byGroupCode = $getInfo_byGroupCodeArr[0]; // 渠道和目的地有重复操作的团
$duplicate = true; $duplicate = true;
} else { } else {
$null_gci = array_map(function ($ele) {
if (intval($ele->COLI_OPI_ID)===435 && $ele->senderIP===''
&& $ele->gci===null
) {
return $ele->COLI_ID;
} else {
return null;
}
}, $getInfo_byGroupCodeArr);
foreach (array_unique(array_filter($null_gci)) as $knull => $vnull) {
$this->order_cancel($vnull);
}
foreach ($getInfo_byGroupCodeArr as $kg => $vg) { foreach ($getInfo_byGroupCodeArr as $kg => $vg) {
// 同步的订单, 修改了团号, 用地接社id匹配 // 同步的订单, 修改了团号, 用地接社id匹配
if(intval($order->COLI_OPI_ID)===435 && $order->GCI_VendorOrderId == $vg->gci) { if(intval($order->COLI_OPI_ID)===435 && $order->GCI_VendorOrderId == $vg->gci) {

@ -433,8 +433,9 @@ class Order_finance extends CI_Controller {
} }
} }
$this_order_real_pag_sns = array_map(function($ele) {return $ele->real_pag_sn;}, $ret->order_cost); $this_order_real_pag_sns = array_map(function($ele) {return $ele->real_pag_sn;}, $ret->order_cost);
$pags_info = $this->OrderFinance_model->get_pag_info(implode(',', array_unique(array_filter($this_order_real_pag_sns)))); // $pag_sns $pags_info = $this->OrderFinance_model->get_pag_info(implode(',', array_unique(array_filter($this_order_real_pag_sns))),$ret->order_cost[0]->vei_sn); // $pag_sns
$ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; $ret->vendor_name = implode(",", array_values(array_unique(array_filter( array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info))))) ;
// $ret->vendor_name = trim($ret->vendor_name);
$ret->pag_name = implode("; ", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; $ret->pag_name = implode("; ", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ;
$ret->PAG_Code = implode(",", $ret->combine_pags); $ret->PAG_Code = implode(",", $ret->combine_pags);
$ret->comment = "拼团" . $combineNo . ", 按" . $ret->person_num . "人等"; $ret->comment = "拼团" . $combineNo . ", 按" . $ret->person_num . "人等";
@ -504,7 +505,7 @@ class Order_finance extends CI_Controller {
$pag_sns = array_values(array_unique(array_map(function($ele) {return $ele->COLD_ServiceSN;}, $all_orders))); $pag_sns = array_values(array_unique(array_map(function($ele) {return $ele->COLD_ServiceSN;}, $all_orders)));
$pags_info = $this->OrderFinance_model->get_pag_info(implode(',', $pag_sns), $all_orders[0]->COLD_PlanVEI_SN); $pags_info = $this->OrderFinance_model->get_pag_info(implode(',', $pag_sns), $all_orders[0]->COLD_PlanVEI_SN);
$ret->PAG_Code = implode(",", array_values(array_unique(array_map(function($ele) {return mb_strtoupper($ele->PAG_Code);}, $pags_info)))); $ret->PAG_Code = implode(",", array_values(array_unique(array_map(function($ele) {return mb_strtoupper($ele->PAG_Code);}, $pags_info))));
$ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; $ret->vendor_name = implode(",", array_values(array_unique(array_filter(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info))))) ;
$ret->pag_name = implode("; ", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; $ret->pag_name = implode("; ", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ;
if ($debug!=false) { if ($debug!=false) {
return $this->output->set_content_type('application/json')->set_output(json_encode($ret)); return $this->output->set_content_type('application/json')->set_output(json_encode($ret));
@ -564,6 +565,7 @@ class Order_finance extends CI_Controller {
"BJALC-209", "BJALC-209",
// "BJSIC-16", // "BJSIC-16",
"SHSIC-45", "SHSIC-45",
"SHSIC-57",
"XASIC-16" "XASIC-16"
); );
} }

@ -298,6 +298,12 @@ class Vendor_money extends CI_Controller {
$vendor_sourcetype = $this->trippest->vendor_sourcetype(); $vendor_sourcetype = $this->trippest->vendor_sourcetype();
// price [Trippest receipts & agency receipts] // price [Trippest receipts & agency receipts]
$ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors)); $ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors));
// 仅更新成本数据, 后重新获取
$to_update = array_values(array_unique(array_filter(array_column($ret['price_error'], 'vendor_order'))));
if ( ! empty($to_update)) {
$this->async_fresh_operation($to_update);
$ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors));
}
// not found in GroupCombineInfo // not found in GroupCombineInfo
$ret['not_found'] = $this->money_model->get_order_not_found_gci($start_date, $end_date, implode(',' ,$vendors)); $ret['not_found'] = $this->money_model->get_order_not_found_gci($start_date, $end_date, implode(',' ,$vendors));
// cost // cost
@ -358,6 +364,17 @@ class Vendor_money extends CI_Controller {
return false; return false;
} }
private function async_fresh_operation($gci_ids)
{
foreach ($gci_ids as $key => $vendor_orderid) {
if ($key > 10) {
break;
}
async_curl("http://www.mycht.cn/webht.php/apps/trippestOrderSync/TulanduoApi/insert_HT_order_operation/0/" . $vendor_orderid, 2);
}
return false;
}
private function diff_xls_ht_cost($xls_data, $HT_combine_cost) private function diff_xls_ht_cost($xls_data, $HT_combine_cost)
{ {
$cost_error = array(); $cost_error = array();

@ -188,7 +188,7 @@ class OrderFinance_model extends CI_Model {
if ($PAG_SN_str=="") { if ($PAG_SN_str=="") {
return array(); return array();
} }
$vei_sql = $cold_vei===null ? 'PAG_DefaultVEI_SN' : "isnull(PAG_DefaultVEI_SN,$cold_vei)"; $vei_sql = $cold_vei===null ? 'PAG_DefaultVEI_SN' : $cold_vei;
$sql = "SELECT pag.PAG_SN,PAG_Code,PAG_DefaultVEI_SN,PAG_Title,vei2.VEI2_CompanyBN $sql = "SELECT pag.PAG_SN,PAG_Code,PAG_DefaultVEI_SN,PAG_Title,vei2.VEI2_CompanyBN
from BIZ_PackageInfo pag from BIZ_PackageInfo pag
left join VEndorInfo2 vei2 on VEI2_VEI_SN=$vei_sql and VEI2_LGC=2 left join VEndorInfo2 vei2 on VEI2_VEI_SN=$vei_sql and VEI2_LGC=2
@ -361,7 +361,7 @@ class OrderFinance_model extends CI_Model {
left(convert(varchar,COLD_EndDate,120),10) AS endtime, left(convert(varchar,COLD_EndDate,120),10) AS endtime,
COLD_Count roomnumber, COLD_Count roomnumber,
isnull(HOI_ExtraNum,0) AS ExtraBedNumber, isnull(HOI_ExtraNum,0) AS ExtraBedNumber,
COLD_DayCount=DATEDIFF(DAY,COLD_StartDate,COLD_EndDate) as jianyeshu, DATEDIFF(DAY,COLD_StartDate,COLD_EndDate) as jianyeshu,
COLD_TotalCost*1.0/dbo.ZeroToOne(DATEDIFF(DAY,COLD_StartDate,COLD_EndDate)) as jianyecost, COLD_TotalCost*1.0/dbo.ZeroToOne(DATEDIFF(DAY,COLD_StartDate,COLD_EndDate)) as jianyecost,
0 as ExtraBedCost, 0 as ExtraBedCost,
0 as ExtraBedPrice, 0 as ExtraBedPrice,

@ -593,12 +593,13 @@ class Orders_model extends CI_Model {
*/ */
public function get_order_by_groupcode($code, $order_id=0, $vei_sn=0) public function get_order_by_groupcode($code, $order_id=0, $vei_sn=0)
{ {
$vei_sn_sql = $vei_sn===0 ? " " : " AND COLD_PlanVEI_SN=$vei_sn "; $vei_sn_sql = $vei_sn===0 ? " " : " AND isnull(COLD_PlanVEI_SN,1343) in (1343,$vei_sn) ";
$sql = "SELECT COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID, $sql = "SELECT COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID,
(select top 1 case gci_vendororderId when $order_id then gci_vendororderId else 0 end (select top 1 case gci_vendororderId when $order_id then gci_vendororderId else 0 end
from groupcombineinfo where gci_gri_sn=coli_gri_sn from groupcombineinfo where gci_gri_sn=coli_gri_sn
order by case gci_vendororderId when $order_id then 0 else 1 end asc order by case gci_vendororderId when $order_id then 0 else 1 end asc
) as gci, ) as gci,
ISNULL(coli.COLI_SenderIP,'') senderIP,
coli.COLI_OrderDetailText,coli.COLI_GroupCode,coli.COLI_GRI_SN, coli.COLI_OrderDetailText,coli.COLI_GroupCode,coli.COLI_GRI_SN,
coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency
GRI_OPI_ID,GRI_operator,GRI_No,GRI_Name, GRI_OPI_ID,GRI_operator,GRI_No,GRI_Name,

@ -399,7 +399,7 @@ class Vendor_money_model extends CI_Model {
,data_tmp.total_income-(round(HT_haina_receipt,1)+ ROUND(HT_agency_receipt,1)) as 'total_income_err' --'海纳收入差额' ,data_tmp.total_income-(round(HT_haina_receipt,1)+ ROUND(HT_agency_receipt,1)) as 'total_income_err' --'海纳收入差额'
,(select top 1 GCI_combineNo from groupcombineinfo where gci_gri_sn=data_tmp.GRI_SN) as combineNo ,(select top 1 GCI_combineNo from groupcombineinfo where gci_gri_sn=data_tmp.GRI_SN) as combineNo
,(select top 1 GCI_VendorOrderId from groupcombineinfo ,(select top 1 GCI_VendorOrderId from groupcombineinfo
where gci_gri_sn=data_tmp.GRI_SN and ( GCI_createTime<'$expire_fresh' or GCI_combineNo is null) where gci_gri_sn=data_tmp.GRI_SN and ( GCI_createTime<'$expire_fresh' )
) as vendor_order ) as vendor_order
,* from ,* from
( (
@ -410,7 +410,7 @@ class Vendor_money_model extends CI_Model {
and COLD_COLI_SN=coli.COLI_SN and COLD_COLI_SN=coli.COLI_SN
) as other_price, ) as other_price,
(select isnull(SUM(cast(GCI_priceCNY as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN and GCI_combineNo<>'cancel' ) as TLD_total_price, (select isnull(SUM(cast(GCI_priceCNY as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN and GCI_combineNo<>'cancel' ) as TLD_total_price,
(select isnull(SUM(cast(GCI_agencyReceipt as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN) as TLD_agency_receipt, (select isnull(SUM(cast(GCI_agencyReceipt as decimal(10,2))),0) from GroupCombineInfo where GCI_GRI_SN=COLI_GRI_SN and GCI_combineNo is not null ) as TLD_agency_receipt,
(select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN (select isnull(SUM(cast(GAI_SSJE as decimal(10,2))),0) from BIZ_GroupAccountInfo where GAI_COLI_SN=COLI_SN
and GAI_Type in (" . PAY_OTHER . ") and GAI_Type in (" . PAY_OTHER . ")
AND GAI_VEI_SN in ($all_vendor,1343) -- 图兰朵的代收 AND GAI_VEI_SN in ($all_vendor,1343) -- 图兰朵的代收

@ -272,7 +272,7 @@
} elseif ($ep['other_price'] !== NULL) { } elseif ($ep['other_price'] !== NULL) {
echo "<p>其他供应商接待的报价/美金:" . $ep['other_price'] . "</p>"; echo "<p>其他供应商接待的报价/美金:" . $ep['other_price'] . "</p>";
} elseif ($ep['vendor_order'] !== null) { } elseif ($ep['vendor_order'] !== null) {
echo "<p>数据未更新, 请到HT中操作.</p>"; // echo "<p>数据未更新, 请到HT中操作.</p>";
} }
?> ?>
</td> </td>

Loading…
Cancel
Save