同步: 渠道订单不记录代收代付数据, 不参与利润计算

feature/trippest
lyt 7 years ago
parent 5a5c399cc3
commit 4073dc449c

@ -439,32 +439,33 @@ class TulanduoApi extends CI_Controller
// 删除旧的录入
$this->Orders_model->biz_groupaccountinfo_cut($coli_sn, $paytype);
if (intval($latest_order_detail[0]->COLI_OPI_ID)===435) {
$gai_vei_sn = $latest_order_detail[0]->COLD_PlanVEI_SN;
// 团款
if (isset($detail_jsonResp->orderDetail->travelFees) ) {
foreach ($detail_jsonResp->orderDetail->travelFees as $ktf => $vtf) {
$this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $vtf->sumMoney, $vtf->sumMoney, $auto_text . "代收" . $vtf->type . ", " . $vtf->remark);
$this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $vtf->sumMoney, $vtf->sumMoney,$gai_vei_sn, $auto_text . "团款" . $vtf->type . ", " . $vtf->remark);
}
}
// 目的地项目组的订单为了避免重复录入, 外联会沟通录入, 这里不写入.
// 代收
if (isset($detail_jsonResp->orderDetail->replaceCollections) ) {
foreach ($detail_jsonResp->orderDetail->replaceCollections as $krc => $vrc) {
$this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $vrc->money, $vrc->money, $auto_text . "代收" . $vrc->type . ", " . $vrc->remark);
}
// foreach ($detail_jsonResp->orderDetail->replaceCollections as $krc => $vrc) {
// $this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $vrc->money, $vrc->money,$gai_vei_sn, $auto_text . "代收" . $vrc->type . ", " . $vrc->remark);
// }
}
if (isset($detail_jsonResp->orderDetail->operationDetails->otherReceives) ) {
foreach ($detail_jsonResp->orderDetail->operationDetails->otherReceives as $koor => $voor) {
$this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $voor->sumMoney, $voor->sumMoney, $auto_text . "代收" . $voor->type . ", " . $voor->remark);
$this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $voor->sumMoney, $voor->sumMoney, $gai_vei_sn, $auto_text . "其他收入" . $voor->type . ", " . $voor->remark);
}
}
// 代付
if (isset($detail_jsonResp->orderDetail->replacePays) ) {
foreach ($detail_jsonResp->orderDetail->replacePays as $krp => $vrp) {
$GAI_SQJE = "-" . $vrp->money;
$GAI_SSJE = "-" . $vrp->money;
$GAI_Memo = $auto_text . $vrp->type . ", " . $vrp->remark;
$this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $GAI_SQJE, $GAI_SSJE, $GAI_Memo);
}
// foreach ($detail_jsonResp->orderDetail->replacePays as $krp => $vrp) {
// $GAI_SQJE = "-" . $vrp->money;
// $GAI_SSJE = "-" . $vrp->money;
// $GAI_Memo = $auto_text . $vrp->type . ", " . $vrp->remark;
// $this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $GAI_SQJE, $GAI_SSJE, $gai_vei_sn, $GAI_Memo);
// }
}
}
/*BIZ_GroupCombineOperationDetail*/
@ -713,7 +714,7 @@ class TulanduoApi extends CI_Controller
return;
}
public function insert_gai($coli_sn, $gri_sn, $coli_id, $paytype, $currency, $sqje, $ssje, $memo="")
public function insert_gai($coli_sn, $gri_sn, $coli_id, $paytype, $currency, $sqje, $ssje, $gai_vei_sn, $memo="")
{
$this->Orders_model->GAI_Operator = 435;
$this->Orders_model->GAI_COLI_SN = $coli_sn;
@ -725,6 +726,7 @@ class TulanduoApi extends CI_Controller
$this->Orders_model->GAI_SSJE = $ssje;
$this->Orders_model->GAI_SSDate = date("Y-m-d H:i:s");
$this->Orders_model->GAI_Memo = $memo;
$this->Orders_model->GAI_VEI_SN = $gai_vei_sn;
return $this->Orders_model->biz_groupaccountinfo_save();
}

@ -1285,6 +1285,7 @@ class Orders_model extends CI_Model {
public $GAI_SSJE;
public $GAI_SSDate;
public $GAI_Operator;
public $GAI_VEI_SN;
public $GAI_Memo="";
public function biz_groupaccountinfo_save()
{
@ -1300,6 +1301,7 @@ class Orders_model extends CI_Model {
. " GAI_SSJE, \n"
. " GAI_SSDate, \n"
. " GAI_Operator, \n"
. " GAI_VEI_SN, \n"
. " GAI_Memo \n"
. " ) \n"
. "VALUES \n"
@ -1314,6 +1316,7 @@ class Orders_model extends CI_Model {
. " ?, \n"
. " ?, \n"
. " ?, \n"
. " ?, \n"
. " ? \n"
. " )";
$query = $this->HT->query($sql, array(
@ -1327,6 +1330,7 @@ class Orders_model extends CI_Model {
,$this->GAI_SSJE
,$this->GAI_SSDate
,$this->GAI_Operator
,$this->GAI_VEI_SN
,$this->GAI_Memo
));
return $query;

Loading…
Cancel
Save