refill_provider.model.php 966 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. defined('InShopNC') or exit('Access Invalid!');
  3. class refill_providerModel extends Model
  4. {
  5. public function __construct()
  6. {
  7. parent::__construct('refill_provider');
  8. }
  9. public function getProviderInfo($cond)
  10. {
  11. return $this->where($cond)->find();
  12. }
  13. public function addProvider($insert){
  14. return $this->insert($insert);
  15. }
  16. public function editProvider($update, $condition)
  17. {
  18. return $this->where($condition)->update($update);
  19. }
  20. public function delProvider($condition)
  21. {
  22. return $this->where($condition)->delete();
  23. }
  24. public function getProviderList($condition, $pagesize = '', $field = '*', $order = 'opened asc , provider_id desc', $limit = '')
  25. {
  26. $list = $this->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
  27. if (empty($list)) return [];
  28. return $list;
  29. }
  30. }