thrid_refill.model.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. declare(strict_types=0);
  3. defined('InShopNC') or exit('Access Invalid!');
  4. class thrid_refillModel extends Model
  5. {
  6. public function getProviderProduct($store_id,$goods_id,$system_code)
  7. {
  8. return $this->table('third_proprice')->where(['store_id' => $store_id,'goods_id' => $goods_id,'system_code' => $system_code])->field('*')->find();
  9. }
  10. public function getProductList($condition, $page = null, $order = '', $field = '*', $limit = '')
  11. {
  12. return $this->table('third_product')->field($field)->where($condition)->order($order)->limit($limit)->page($page)->select();
  13. }
  14. public function getMerchantPrice($mchid,$pcode)
  15. {
  16. $item = $this->table('merchant_price')
  17. ->field('*')
  18. ->where(['mchid' => $mchid, 'pcode' => $pcode])
  19. ->find();
  20. if(empty($item)) {
  21. return false;
  22. }
  23. $card_types = explode(',',$item['card_types']);
  24. if(in_array(mtopcard\ThirdRefillCard,$card_types)) {
  25. return ncPriceFormat($item['price']);
  26. } else {
  27. return false;
  28. }
  29. }
  30. public function addExt($data)
  31. {
  32. }
  33. }