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

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); $this->Orders_model->biz_groupaccountinfo_cut($coli_sn, $paytype);
if (intval($latest_order_detail[0]->COLI_OPI_ID)===435) { 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) ) { if (isset($detail_jsonResp->orderDetail->travelFees) ) {
foreach ($detail_jsonResp->orderDetail->travelFees as $ktf => $vtf) { 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) ) { if (isset($detail_jsonResp->orderDetail->replaceCollections) ) {
foreach ($detail_jsonResp->orderDetail->replaceCollections as $krc => $vrc) { // 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); // $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) ) { if (isset($detail_jsonResp->orderDetail->operationDetails->otherReceives) ) {
foreach ($detail_jsonResp->orderDetail->operationDetails->otherReceives as $koor => $voor) { 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) ) { if (isset($detail_jsonResp->orderDetail->replacePays) ) {
foreach ($detail_jsonResp->orderDetail->replacePays as $krp => $vrp) { // foreach ($detail_jsonResp->orderDetail->replacePays as $krp => $vrp) {
$GAI_SQJE = "-" . $vrp->money; // $GAI_SQJE = "-" . $vrp->money;
$GAI_SSJE = "-" . $vrp->money; // $GAI_SSJE = "-" . $vrp->money;
$GAI_Memo = $auto_text . $vrp->type . ", " . $vrp->remark; // $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); // $this->insert_gai($coli_sn, $groupSN, $coli_id, $paytype, $pay_currency, $GAI_SQJE, $GAI_SSJE, $gai_vei_sn, $GAI_Memo);
} // }
} }
} }
/*BIZ_GroupCombineOperationDetail*/ /*BIZ_GroupCombineOperationDetail*/
@ -713,7 +714,7 @@ class TulanduoApi extends CI_Controller
return; 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_Operator = 435;
$this->Orders_model->GAI_COLI_SN = $coli_sn; $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_SSJE = $ssje;
$this->Orders_model->GAI_SSDate = date("Y-m-d H:i:s"); $this->Orders_model->GAI_SSDate = date("Y-m-d H:i:s");
$this->Orders_model->GAI_Memo = $memo; $this->Orders_model->GAI_Memo = $memo;
$this->Orders_model->GAI_VEI_SN = $gai_vei_sn;
return $this->Orders_model->biz_groupaccountinfo_save(); return $this->Orders_model->biz_groupaccountinfo_save();
} }

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

Loading…
Cancel
Save