Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. function checkunitconversionexist($itemid,$itemunits){
  2.  
  3. for($i=0; $i<count($itemid); $i++){
  4.  
  5. $finditemsinfos=DB::table('items')->Where('id',$itemid[$i])->first();
  6.  
  7.  
  8. if($finditemsinfos->unit == $itemunits[$i]){
  9.  
  10. return 1;
  11.  
  12. } else {
  13.  
  14. $chkunitconversionexist=DB::table('unitconversion')->Where('itemsid',$itemid[$i])->Where('unit_name',$finditemsinfos->unit)->Where('subunit_name',$itemunits[$i])->get();
  15.  
  16. if(count($chkunitconversionexist) > 0){
  17.  
  18. return 1;
  19.  
  20. } else {
  21.  
  22. return 0;
  23.  
  24. }
  25.  
  26.  
  27. }
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement