作者 王智

修复生成订单号 失败

... ... @@ -329,7 +329,7 @@ class Index extends Api
$OrderSn = $this->order_sn();
//押金
$MoneyArr = Db::name('money_config')->where('battery_id', $params['battery_id'])->find();
$res111 = Db::name('agreement')->where('user_id', $UserId)->where('seller_id', $params['seller_id'])->where('status', 'IN', '0,1')->where('pay','NEQ',0)
$res111 = Db::name('agreement')->where('user_id', $UserId)->where('seller_id', $params['seller_id'])->where('status', 'IN', '0,1')->where('pay', 'NEQ', 0)
->find();
if (!empty($res111)) {
$this->error('禁止重复签订协议', 0);
... ... @@ -498,7 +498,7 @@ class Index extends Api
->join('seller s', 's.id=a.seller_id')
->where('s.user_id', $UserId)
->join('user u', 'u.id=a.user_id')
->where('a.pay','NEQ',0)
->where('a.pay', 'NEQ', 0)
->where($map)
->page($params['pages'], $params['rows'])
->order('id desc')
... ... @@ -508,7 +508,7 @@ class Index extends Api
->alias('a')
->join('seller s', 's.id=a.seller_id')
->where('s.user_id', $UserId)
->where('a.pay','NEQ',0)
->where('a.pay', 'NEQ', 0)
->join('user u', 'u.id=a.user_id')
->where('a.status', $params['type'])
->order('id desc')
... ... @@ -567,7 +567,7 @@ class Index extends Api
->join('user u', 'u.id=a.user_id')
->where('s.user_id', $UserId)
->where('a.refind_status', $params['type'])
->where('a.pay','NEQ',0)
->where('a.pay', 'NEQ', 0)
->page($params['pages'], $params['rows'])
->order('id desc')
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status')
... ... @@ -576,7 +576,7 @@ class Index extends Api
->alias('a')
->join('seller s', 's.id=a.seller_id')
->join('user u', 'u.id=a.user_id')
->where('a.pay','NEQ',0)
->where('a.pay', 'NEQ', 0)
->where('s.user_id', $UserId)
->where('a.refind_status', $params['type'])
->order('id desc')
... ... @@ -683,7 +683,8 @@ class Index extends Api
{
$UserId = $this->IsToken($this->request->header());
$params = $this->request->param();
$map['BatteryCode'] = ['LIKE', '%' . $params['battery_code'] . '%'];
$battery_code = explode('-', $params['battery_code']);
$map['BatteryCode'] = ['LIKE', '%' . $battery_code[1] . '%'];
//用户电池分类ID
$Id = Db::name('battery_code')->where($map)->value('id');
if (empty($Id)) {
... ... @@ -861,7 +862,7 @@ class Index extends Api
->where('a.user_id', $UserId)
->join('seller s', 's.id=a.seller_id')
->page($params['pages'], $params['rows'])
->where('a.pay','NEQ',0)
->where('a.pay', 'NEQ', 0)
->order('id desc')
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,s.CompanyName')
->select();
... ... @@ -869,7 +870,7 @@ class Index extends Api
->alias('a')
->join('seller s', 's.id=a.seller_id')
->where('a.user_id', $UserId)
->where('a.pay','NEQ',0)
->where('a.pay', 'NEQ', 0)
->order('id desc')
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,s.CompanyName')
->select();
... ...