Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getProduct1($sp_id){
- $this->db->select('*');
- $this->db->from('product');
- $this->db->where('pd_supplier',$sp_id);
- $this->db->where('pd_status',1);
- $this->db->join('stock','product.pd_code=stock.stock_product_id');
- $this->db->group_by('stock.stock_product_id');
- $this->db->where('stock.stock_qty < product.pd_min');
- $this->db->select_max('stock.stock_id');
- $this->db->order_by('stock.stock_id', 'desc');
- $query = $this->db->get();
- $row = $query->result();
- return $row;
- }
Add Comment
Please, Sign In to add comment