feat: 预审核增加更新数据

feature/trippest
lyt 6 years ago
parent 80a397afcb
commit 215575ad59

@ -298,6 +298,12 @@ class Vendor_money extends CI_Controller {
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
// price [Trippest receipts & agency receipts]
$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
$ret['not_found'] = $this->money_model->get_order_not_found_gci($start_date, $end_date, implode(',' ,$vendors));
// cost
@ -358,6 +364,17 @@ class Vendor_money extends CI_Controller {
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)
{
$cost_error = array();

@ -385,7 +385,7 @@ class Vendor_money_model extends CI_Model {
public function get_precheck_price_error($start_date, $end_date, $all_vendor)
{
$expire_fresh = date('Y-m-d',strtotime("+62 days", strtotime($start_date)));
$expire_fresh = date('Y-m-d',strtotime("+2 months", strtotime($start_date)));
$sql = "SELECT
data_tmp.TLD_total_price-(HT_haina_receipt+HT_agency_receipt) as 'total_price_err', --总团款差额 (账单减HT)',
case data_tmp.COLI_OPI_ID when 435
@ -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' --'海纳收入差额'
,(select top 1 GCI_combineNo from groupcombineinfo where gci_gri_sn=data_tmp.GRI_SN) as combineNo
,(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
,* from
(
@ -410,7 +410,7 @@ class Vendor_money_model extends CI_Model {
and COLD_COLI_SN=coli.COLI_SN
) 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_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
and GAI_Type in (" . PAY_OTHER . ")
AND GAI_VEI_SN in ($all_vendor,1343) -- 图兰朵的代收

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

Loading…
Cancel
Save