BalancePlan.php 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\shop\model\user;
  3. use app\common\model\user\BalancePlan as BalancePlanModel;
  4. /**
  5. * 充值模型
  6. */
  7. class BalancePlan extends BalancePlanModel
  8. {
  9. /**
  10. * 列表
  11. */
  12. public function getList($params)
  13. {
  14. return $this->where('is_delete', '=', 0)
  15. ->order(['sort' => 'asc', 'create_time' => 'desc'])
  16. ->select();
  17. }
  18. /**
  19. * 添加新记录
  20. */
  21. public function add($data)
  22. {
  23. $data['app_id'] = self::$app_id;
  24. return $this->save($data);
  25. }
  26. /**
  27. * 更新记录
  28. */
  29. public function edit($data)
  30. {
  31. return $this->save($data);
  32. }
  33. /**
  34. * 删除记录 (软删除)
  35. */
  36. public function setDelete($where)
  37. {
  38. return self::update(['is_delete' => 1], $where);
  39. }
  40. }