1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- defined('InShopNC') or exit('Access Invalid!');
- class merchantModel extends Model
- {
- public function getMerchant($mchid)
- {
- return $this->table('merchant')->where(['mchid' => $mchid])->select();
- }
- public function addMerchant($insert){
- return $this->table('merchant')->insert($insert);
- }
- public function getMerchantInfo($condition, $field = '*')
- {
- $result = $this->table('merchant')->where($condition)->field($field)->find();
- return $result;
- }
- public function getMerchantList($condition, $page = null, $order = '', $field = '*', $limit = '')
- {
- $result = $this->table('merchant,member')->join('inner')->on('member.member_id=merchant.admin_id')
- ->field($field)->where($condition)->order($order)->limit($limit)->page($page)->select();
- return $result;
- }
- public function getPrices($mchid, $amount,$quality)
- {
- return $this->table('merchant_price')->where(['mchid' => $mchid, 'spec' => $amount , 'quality' => $quality])->select();
- }
- public function delPrices($condition){
- return $this->table('merchant_price')->where($condition)->delete();
- }
- public function insertPrices($params){
- return $this->table('merchant_price')->insertAll($params);
- }
- public function editMerchant($update, $condition)
- {
- return $this->table('merchant')->where($condition)->update($update);
- }
- public function getPdlog($condition, $pagesize = '', $field = '*', $order = '', $limit = '')
- {
- $pdlog = $this->table('pd_log')->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
- if (empty($pdlog)) return [];
- return $pdlog;
- }
- public function addRefillEvidence($params)
- {
- return $this->table('refill_evidence')->insert($params);
- }
- public function getRefillEvidence($condition, $pagesize = '', $field = '*', $order = '', $limit = '')
- {
- $list = $this->table('refill_evidence,member')->join('inner')->on('member.member_id=refill_evidence.member_id')->field($field)->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
- if (empty($list)) return [];
- return $list;
- }
- public function getRefillEvidenceInfo($condition, $field = '*')
- {
- $result = $this->table('refill_evidence,member')->join('inner')->on('member.member_id=refill_evidence.member_id')->where($condition)->field($field)->find();
- return $result;
- }
- public function editRefillEvidence($condition , $update)
- {
- return $this->table('refill_evidence')->where($condition)->update($update);
- }
- }
|