|
|
|
|
@ -22,19 +22,13 @@ class Group_model extends CI_Model {
|
|
|
|
|
inner join GRoupInfo gri on GRI_SN=VAS_GRI_SN
|
|
|
|
|
where 1=1 AND VAS_VEI_SN in ($vendor_str) ";
|
|
|
|
|
$sql .= $gri_sn!==0 ? $gri_sql : "
|
|
|
|
|
AND VAS_IsCancel=0 AND VAS_Delete=0 AND vas.DeleteFlag=0
|
|
|
|
|
AND VAS_IsSendSucceed=1 AND VAS_IsReceive=0
|
|
|
|
|
AND EOI_GetDate between '$start_date' AND '$end_date'
|
|
|
|
|
-- AND EOI_GetDate > CONVERT(date, GETDATE()) -- released
|
|
|
|
|
-- Trippest, not confirm, not change -- for Trippest deploy
|
|
|
|
|
-- AND GRI_OrderType=227002
|
|
|
|
|
AND VAS_IsConfirm=0 AND VAS_SendVary=0
|
|
|
|
|
-- AND EXISTS (
|
|
|
|
|
-- select 1 from OperatorInfo where OPI_SN=GRI_operator AND OPI_DEI_SN=30
|
|
|
|
|
-- )
|
|
|
|
|
AND isnull(VAS_IsCancel,0)=0 AND isnull(VAS_Delete,0)=0 AND isnull(vas.DeleteFlag,0)=0
|
|
|
|
|
AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0
|
|
|
|
|
-- AND EOI_GetDate between '$start_date' AND '$end_date'
|
|
|
|
|
AND EOI_GetDate > CONVERT(date, GETDATE())
|
|
|
|
|
AND isnull(VAS_IsConfirm,0)=0 AND isnull(VAS_SendVary,0)=0
|
|
|
|
|
";
|
|
|
|
|
$sql .= " order by EOI_GetDate asc,vas.VAS_SendTime asc, vas.VAS_IsConfirm asc";
|
|
|
|
|
log_message('error',$sql);
|
|
|
|
|
return $this->HT->query($sql)->result();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -69,7 +63,6 @@ log_message('error',$sql);
|
|
|
|
|
'ReturnDatesAsStrings' => 1
|
|
|
|
|
);
|
|
|
|
|
$conn = sqlsrv_connect($db['HT']['hostname'], $connection);
|
|
|
|
|
log_message('error', "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanInfo $gri_sn, $vendor_id, 0 ");
|
|
|
|
|
$stmt = sqlsrv_query($conn, "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanInfo $gri_sn, $vendor_id, 0 ");
|
|
|
|
|
$result_object = array();
|
|
|
|
|
if (false !== $stmt ) { // 无权限或执行错误返回false
|
|
|
|
|
@ -177,9 +170,6 @@ log_message('error', "SET NOCOUNT ON;EXEC Tourmanager.dbo.SP_VendorPlan_GetPlanI
|
|
|
|
|
$vendor_sql
|
|
|
|
|
$day_no_sql
|
|
|
|
|
order by ACI_DayNo,ACI_SNInOneDay ";
|
|
|
|
|
|
|
|
|
|
log_message('error',$this->HT->compile_binds($sql, $param_arr));
|
|
|
|
|
|
|
|
|
|
return $this->HT->query($sql, $param_arr)->result();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -304,7 +294,6 @@ log_message('error',$this->HT->compile_binds($sql, $param_arr));
|
|
|
|
|
public function set_plan_received($vas_sn=0)
|
|
|
|
|
{
|
|
|
|
|
$sql = "UPDATE VendorArrangeState set VAS_IsReceive=1,VAS_ReceiveTime=GETDATE() where VAS_SN=? ";
|
|
|
|
|
log_message('error',$sql . $vas_sn);
|
|
|
|
|
return $this->HT->query($sql, array($vas_sn));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -333,7 +322,6 @@ log_message('error',$sql . $vas_sn);
|
|
|
|
|
public function insert_VendorPlanSync($sync_arr=array())
|
|
|
|
|
{
|
|
|
|
|
$ss = $this->HT->insert_string('VendorPlanSendout', $sync_arr); // testing
|
|
|
|
|
log_message('error',$ss);
|
|
|
|
|
$this->HT->insert('VendorPlanSendout', $sync_arr);
|
|
|
|
|
return $this->HT->query("SELECT MAX(VPS_SN) VPS_SN from VendorPlanSendout")
|
|
|
|
|
->row()->VPS_SN;
|
|
|
|
|
@ -343,7 +331,6 @@ log_message('error',$ss);
|
|
|
|
|
{
|
|
|
|
|
$where = " VPS_SN=" . $vps;
|
|
|
|
|
$update_sql = $this->HT->update_string('VendorPlanSendout', $sync_arr, $where);
|
|
|
|
|
log_message('error',$update_sql);
|
|
|
|
|
return $this->HT->query($update_sql);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|