|
|
|
|
@ -593,12 +593,13 @@ class Orders_model extends CI_Model {
|
|
|
|
|
*/
|
|
|
|
|
public function get_order_by_groupcode($code, $order_id=0, $vei_sn=0)
|
|
|
|
|
{
|
|
|
|
|
$vei_sn_sql = $vei_sn===0 ? " " : " AND COLD_PlanVEI_SN=$vei_sn ";
|
|
|
|
|
$vei_sn_sql = $vei_sn===0 ? " " : " AND isnull(COLD_PlanVEI_SN,1343) in (1343,$vei_sn) ";
|
|
|
|
|
$sql = "SELECT COLI_SN,gri.GRI_SN,cold.COLD_PlanVEI_SN,cold.COLD_SN,coli.COLI_ID,
|
|
|
|
|
(select top 1 case gci_vendororderId when $order_id then gci_vendororderId else 0 end
|
|
|
|
|
from groupcombineinfo where gci_gri_sn=coli_gri_sn
|
|
|
|
|
order by case gci_vendororderId when $order_id then 0 else 1 end asc
|
|
|
|
|
) as gci,
|
|
|
|
|
ISNULL(coli.COLI_SenderIP,'') senderIP,
|
|
|
|
|
coli.COLI_OrderDetailText,coli.COLI_GroupCode,coli.COLI_GRI_SN,
|
|
|
|
|
coli.COLI_State,coli.COLI_OPI_ID,coli.COLI_Price,coli.COLI_CUrrency
|
|
|
|
|
GRI_OPI_ID,GRI_operator,GRI_No,GRI_Name,
|
|
|
|
|
|