Anonymous
Ich habe zwei verschiedene Arten von Bedingungen in meinem Modell, um die lr_no-Nummer zu überprüfen. Wie kann ich die i
Post
by Anonymous » 16 Jan 2026, 04:56
In meinem Modell habe ich zwei verschiedene Arten von Bedingungen für check lr_no Wie kann ich die Bedingung in der Steuerung überprüfen? Ich versuche es so.
Ansicht:
Code: Select all
$('#lr_no').change(function(event) {
var lr_no = $('#lr_no').val();
$.ajax({
url : "crossing/crossing_cash_memo/CashMemoController/fetchCrossType",
type:"POST",
dataType: "json",
data: {
lr_no :lr_no
},
success: function(data){
console.log(data);
},
error:function(data){
alert("error message"+data);
},async:false,
});
});
Controller:
Code: Select all
public function fetchCrossType(){
$id = $this->input->post('lr_no');
}
Modell:
Code: Select all
public function getBiltyNo($lr_no){
$crossQuery = $this->db->select('*')
->from('truck_freight')
->join('crossing_received', 'crossing_received.crossing_rec_frtno = truck_freight.fr_memo_ids')
->where('crossing_rec_type','cross_received')
->get()->result();
if ($crossQuery != "") {
$query = $this->db->select('*')
->from('truck_freight')
->join('crossing_received', 'crossing_received.crossing_rec_frtno = truck_freight.fr_memo_ids')
->join('frieght_challan', 'frieght_challan.frieght_id = truck_freight.fr_memo_ids')
->join('challan_bilties', 'challan_bilties.challan_id = frieght_challan.dispatch_id')
->join('bilty', 'bilty.id = challan_bilties.bilty_id')
->join('delivery_stock',"bilty.id = delivery_stock.sbilty_id")
->where('sstatus','delivery_bilty')
->where('lr_no', $lr_no)
->get()->num_rows();
if ($query >0) {
return array('form_message' => 'LR no Found', 'form_status' => 'bilty_found');
} else {
return array('form_message' => 'LR NO not found (in Crossing Received)', 'form_status' => 'biltynotfound');
}
} else {
return array('form_message' => 'crossing not received', 'form_status' => 'notRecevied');
}
}
public function getBiltyByNo($bilty_no){
$crossQuery = $this->db->select('*')
->from('delivery_local_truck_freight')
->join('crossing_received', 'crossing_received.crossing_rec_frtno = delivery_local_truck_freight.loc_truck_ids')
->where('crossing_rec_type', 'del_loc_cross_received')
->get()->num_rows();
if ($crossQuery > 0) {
$query = $this->db->select('*')
->from('delivery_local_truck_freight')
->join('crossing_received', 'crossing_received.crossing_rec_frtno = delivery_local_truck_freight.loc_truck_ids')
->join('delivery_local_freight_challan', 'delivery_local_freight_challan.loc_frieght_id = delivery_local_truck_freight.loc_truck_ids')
->join('delivery_local_challan_bilties', 'delivery_local_challan_bilties.challan_id = delivery_local_freight_challan.local_id')
->join('bilty', 'bilty.id = delivery_local_challan_bilties.bilty_id')
->join('delivery_stock',"bilty.id = delivery_stock.sbilty_id")
->where('sstatus','delivery_local_received')
->where('crossing_received.crossing_rec_type','del_loc_cross_received')
->where('lr_no', $bilty_no)
->get()->num_rows();
if ($query == 1) {
return array('form_message' => 'LR NO Found', 'form_status' => 'bilty_found');
} else {
return array('form_message' => 'LR No not found (in Delivery Crossing Received)', 'form_status' => 'biltynotfound');
}
} else {
return array('form_message' => 'crossing not received', 'form_status' => 'notRecevied');
}
}
Wie kann ich den Zustand im Controller für zwei verschiedene Modellbedingungen überprüfen
1768535808
Anonymous
In meinem Modell habe ich zwei verschiedene Arten von Bedingungen für check lr_no Wie kann ich die Bedingung in der Steuerung überprüfen? Ich versuche es so. Ansicht: [code]$('#lr_no').change(function(event) { var lr_no = $('#lr_no').val(); $.ajax({ url : "crossing/crossing_cash_memo/CashMemoController/fetchCrossType", type:"POST", dataType: "json", data: { lr_no :lr_no }, success: function(data){ console.log(data); }, error:function(data){ alert("error message"+data); },async:false, }); }); [/code] Controller: [code]public function fetchCrossType(){ $id = $this->input->post('lr_no'); } [/code] Modell: [code] public function getBiltyNo($lr_no){ $crossQuery = $this->db->select('*') ->from('truck_freight') ->join('crossing_received', 'crossing_received.crossing_rec_frtno = truck_freight.fr_memo_ids') ->where('crossing_rec_type','cross_received') ->get()->result(); if ($crossQuery != "") { $query = $this->db->select('*') ->from('truck_freight') ->join('crossing_received', 'crossing_received.crossing_rec_frtno = truck_freight.fr_memo_ids') ->join('frieght_challan', 'frieght_challan.frieght_id = truck_freight.fr_memo_ids') ->join('challan_bilties', 'challan_bilties.challan_id = frieght_challan.dispatch_id') ->join('bilty', 'bilty.id = challan_bilties.bilty_id') ->join('delivery_stock',"bilty.id = delivery_stock.sbilty_id") ->where('sstatus','delivery_bilty') ->where('lr_no', $lr_no) ->get()->num_rows(); if ($query >0) { return array('form_message' => 'LR no Found', 'form_status' => 'bilty_found'); } else { return array('form_message' => 'LR NO not found (in Crossing Received)', 'form_status' => 'biltynotfound'); } } else { return array('form_message' => 'crossing not received', 'form_status' => 'notRecevied'); } } public function getBiltyByNo($bilty_no){ $crossQuery = $this->db->select('*') ->from('delivery_local_truck_freight') ->join('crossing_received', 'crossing_received.crossing_rec_frtno = delivery_local_truck_freight.loc_truck_ids') ->where('crossing_rec_type', 'del_loc_cross_received') ->get()->num_rows(); if ($crossQuery > 0) { $query = $this->db->select('*') ->from('delivery_local_truck_freight') ->join('crossing_received', 'crossing_received.crossing_rec_frtno = delivery_local_truck_freight.loc_truck_ids') ->join('delivery_local_freight_challan', 'delivery_local_freight_challan.loc_frieght_id = delivery_local_truck_freight.loc_truck_ids') ->join('delivery_local_challan_bilties', 'delivery_local_challan_bilties.challan_id = delivery_local_freight_challan.local_id') ->join('bilty', 'bilty.id = delivery_local_challan_bilties.bilty_id') ->join('delivery_stock',"bilty.id = delivery_stock.sbilty_id") ->where('sstatus','delivery_local_received') ->where('crossing_received.crossing_rec_type','del_loc_cross_received') ->where('lr_no', $bilty_no) ->get()->num_rows(); if ($query == 1) { return array('form_message' => 'LR NO Found', 'form_status' => 'bilty_found'); } else { return array('form_message' => 'LR No not found (in Delivery Crossing Received)', 'form_status' => 'biltynotfound'); } } else { return array('form_message' => 'crossing not received', 'form_status' => 'notRecevied'); } } [/code] Wie kann ich den Zustand im Controller für zwei verschiedene Modellbedingungen überprüfen