|
|
|
<?php
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
class Group_model extends CI_Model {
|
|
|
|
|
|
|
|
function __construct() {
|
|
|
|
parent::__construct();
|
|
|
|
$this->HT = $this->load->database('HT', TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_plan_not_received($top=1, $vei_sn_str, $start_date=null, $end_date=null)
|
|
|
|
{
|
|
|
|
$top_sql = $top>0 ? " TOP $top " : "";
|
|
|
|
$sql = "SELECT $top_sql VAS_IsConfirm, VAS_SendVary, GRI_OrderType, GRI_SN, GRI_No, GRI_operator,
|
|
|
|
(select OPI_DEI_SN from OperatorInfo where OPI_SN=GRI_operator) as department,
|
|
|
|
vas.*
|
|
|
|
from VendorArrangeState vas
|
|
|
|
inner join Eva_ObjectInfo eoi on EOI_GRI_SN=VAS_GRI_SN and EOI_Type=1 and EOI_ObjSN=VAS_VEI_SN
|
|
|
|
inner join GRoupInfo gri on GRI_SN=VAS_GRI_SN
|
|
|
|
where 1=1
|
|
|
|
and VAS_IsCancel=0 and VAS_Delete=0 and vas.DeleteFlag=0
|
|
|
|
and VAS_IsSendSucceed=1
|
|
|
|
and VAS_IsConfirm=0
|
|
|
|
and EOI_GetDate between '$start_date' and '$end_date'
|
|
|
|
and VAS_VEI_SN in ($vei_sn_str)
|
|
|
|
and (VAS_IsReceive=0 or (VAS_SendTime > ISNULL(VAS_ReceiveTime,0)))
|
|
|
|
order by EOI_GetDate asc, vas.VAS_IsConfirm asc ";
|
|
|
|
return $this->HT->query($sql)->result();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_vendor_plan_info($gri_sn, $vendor_id)
|
|
|
|
{
|
|
|
|
$sql = " SP_VendorPlan_GetPlanInfo $gri_sn, $vendor_id, 0 ";
|
|
|
|
return $this->HT->query($sql)->result();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/* End of file Group_model.php */
|
|
|
|
/* Location: ./third_party/vendorPlanSync/models/Group_model.php */
|