|
@@ -88,7 +88,7 @@ class Supplier extends Base
|
|
|
$contact = Db::name('contact')->where('tag','supplier')->field('qrcode contact_qrcode,phone contact_phone,email contact_email')->find();
|
|
|
$contact['phone'] = $detail['phone'];
|
|
|
$contact['email'] = $detail['email'];
|
|
|
- $contact['qr_code'] = $detail['qr_code'];;
|
|
|
+ $contact['qr_code'] = $detail['qr_code'];
|
|
|
$this->success('ok',$contact);
|
|
|
|
|
|
}
|
|
@@ -153,8 +153,10 @@ class Supplier extends Base
|
|
|
$v['label_name'] =$v['label'] ? explode(',',trim($v['label'],',')):null;
|
|
|
$v['business_arr'] = $v['business'] ? explode(',',trim($v['business'],',')) : null;
|
|
|
}
|
|
|
- $total_num =\app\common\model\Supplier::where($sel_where)->count();
|
|
|
- $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num)]);
|
|
|
+ $total_num =\app\common\model\Supplier::where($sel_where)->when($title,function ($query)use($title){
|
|
|
+ if($title) $query->where('title|label','like','%'.$title.'%');
|
|
|
+ })->count();
|
|
|
+ $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num),'total_count'=>$total_num,'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -232,8 +234,9 @@ class Supplier extends Base
|
|
|
$v['label_name'] = $v['label']? explode(',',trim($v['label'],',')) : null;
|
|
|
$v['cover_arr'] = $v['cover']? explode('|',trim($v['cover'],'|')):null;
|
|
|
});
|
|
|
-
|
|
|
- $this->success('ok',['list'=>$list]);
|
|
|
+ $sql2 = "SELECT $field FROM " .$table . " a LEFT JOIN ( SELECT id,IF(id,1,1) is_recommend FROM $table b WHERE ( $where_str )) AS c ON c.id = a.id LEFT JOIN dd_supplier as k ON a.supplier_id = k.id WHERE a.is_deleted = 0 AND a.status = 1 AND k.status =1 AND k.is_deleted = 0 ";
|
|
|
+ $total = Db::query($sql2);
|
|
|
+ $this->success('ok',['list'=>$list,'total_count'=>$total[0]['num'],'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -285,8 +288,7 @@ class Supplier extends Base
|
|
|
$sel_where[] = ['is_deleted','=',0];
|
|
|
$sel_where[] = ['status','=',1];
|
|
|
$sel_where[] = ['supplier_id','=',$supplier_id];
|
|
|
- $list = SupplierGoods::where($sel_where)
|
|
|
- ->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
|
|
|
+ $list = SupplierGoods::where($sel_where)->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
|
|
|
$supplier_info = \app\common\model\Supplier::where('id',$supplier_id)->find()->toArray();
|
|
|
foreach ($list as &$v) {
|
|
|
$v['label_name'] =$v['label'] ? explode(',',trim($v['label'],',')):null;
|
|
@@ -295,7 +297,7 @@ class Supplier extends Base
|
|
|
$v['supplier_logo'] =$supplier_info['logo'];
|
|
|
}
|
|
|
$total_num = SupplierGoods::where($sel_where)->count();
|
|
|
- $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num)]);
|
|
|
+ $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num),'total_count'=>$total_num,'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -424,7 +426,7 @@ class Supplier extends Base
|
|
|
$total_num = SupplierGoods::where($sel_where)->alias('g')->leftJoin('Supplier s','g.supplier_id = s.id')->when($search_name,function ($query)use($search_name){
|
|
|
if($search_name) $query->where('g.name|g.label','like','%'.$search_name.'%');
|
|
|
})->count();
|
|
|
- $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num)]);
|
|
|
+ $this->success('ok',['list'=>$list,'total_num'=>numTransform($total_num),'total_count'=>$total_num,'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -548,7 +550,8 @@ class Supplier extends Base
|
|
|
$v['supplier_name'] = \app\common\model\Supplier::where('id',$v['supplier_id'])->value('title');
|
|
|
$v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'],0,$this->request->controller());
|
|
|
}
|
|
|
- $this->success('ok',['list'=>$list]);
|
|
|
+ $total_num =UserTrack::where($sel_where)->alias('t')->leftJoin('SupplierGoods i','t.first_id = i.id')->count();
|
|
|
+ $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -590,7 +593,8 @@ class Supplier extends Base
|
|
|
$v['supplier_name'] = \app\common\model\Supplier::where('id',$v['supplier_id'])->value('title');
|
|
|
$v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'],0,$this->request->controller());
|
|
|
}
|
|
|
- $this->success('ok',['list'=>$list]);
|
|
|
+ $total_num = PlatformLike::where($sel_where)->alias('t')->leftJoin('SupplierGoods i','t.like_id = i.id')->count();
|
|
|
+ $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -634,7 +638,8 @@ class Supplier extends Base
|
|
|
$v['supplier_name'] = \app\common\model\Supplier::where('id',$v['supplier_id'])->value('title');
|
|
|
$v['is_normal'] = CheckPower::checkModulesPower($v['goods_id'],0,$this->request->controller());
|
|
|
}
|
|
|
- $this->success('ok',['list'=>$list]);
|
|
|
+ $total_num= UserCollect::where($sel_where)->alias('t') ->leftJoin('SupplierGoods i','t.coll_id = i.id')->count();
|
|
|
+ $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -679,7 +684,8 @@ class Supplier extends Base
|
|
|
->limit($this->off_set,$this->page_num)
|
|
|
->order('p.id desc')
|
|
|
->select()->toArray();
|
|
|
- $this->success('ok',['list'=>$list]);
|
|
|
+ $total_num= PlatformSwitch::where($sel_where)->alias('p')->leftJoin('Supplier a','p.switch_id = a.id')->count();
|
|
|
+ $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
|
|
|
}
|
|
|
|
|
|
|