Productinfo.php 898 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. class Productinfo extends Model
  5. {
  6. public function getProductInfo($condition)
  7. {
  8. $result = $this
  9. ->where($condition)
  10. ->select();
  11. return $result;
  12. }
  13. public function findProductInfo($condition)
  14. {
  15. $result = $this
  16. ->where($condition)
  17. ->find();
  18. return $result;
  19. }
  20. public function updateProductInfo($id, $data)
  21. {
  22. $result = $this
  23. ->where(['productInfo_id' => $id])
  24. ->update($data);
  25. return $result;
  26. }
  27. public function deleteProductInfo($condition)
  28. {
  29. $result = $this
  30. ->where($condition)
  31. ->delete();
  32. return $result;
  33. }
  34. public function addProductInfo($data)
  35. {
  36. $result = $this
  37. ->insert($data);
  38. return $result;
  39. }
  40. }