FullReduce.php 900 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace app\supplier\model\settings;
  3. use app\common\model\shop\FullReduce as FullReduceModel;
  4. /**
  5. * 满减模型
  6. */
  7. class FullReduce extends FullReduceModel
  8. {
  9. /**
  10. * 获取列表记录
  11. */
  12. public function getList($data)
  13. {
  14. return $this->where('is_delete', '=', 0)
  15. ->where('shop_supplier_id',$data['shop_supplier_id'])
  16. ->order(['create_time' => 'asc'])
  17. ->paginate($data);
  18. }
  19. /**
  20. * 新增记录
  21. */
  22. public function add($data)
  23. {
  24. $data['app_id'] = self::$app_id;
  25. return $this->save($data);
  26. }
  27. /**
  28. * 编辑记录
  29. */
  30. public function edit($data)
  31. {
  32. return $this->save($data);
  33. }
  34. /**
  35. * 软删除
  36. */
  37. public function setDelete()
  38. {
  39. return $this->save(['is_delete' => 1]);
  40. }
  41. }