Guest User

Untitled

a guest
Jul 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public function getProduct1($sp_id){
  2.  
  3. $this->db->select('*');
  4. $this->db->from('product');
  5. $this->db->where('pd_supplier',$sp_id);
  6. $this->db->where('pd_status',1);
  7. $this->db->join('stock','product.pd_code=stock.stock_product_id');
  8. $this->db->group_by('stock.stock_product_id');
  9. $this->db->where('stock.stock_qty < product.pd_min');
  10. $this->db->select_max('stock.stock_id');
  11. $this->db->order_by('stock.stock_id', 'desc');
  12. $query = $this->db->get();
  13. $row = $query->result();
  14. return $row;
  15. }
Add Comment
Please, Sign In to add comment