Commit 35897033 authored by hangjun83's avatar hangjun83

接口更新

parent abfa5101
...@@ -23,9 +23,10 @@ class PlatformCustomerRepositoryEloquent extends BaseRepository implements Platf ...@@ -23,9 +23,10 @@ class PlatformCustomerRepositoryEloquent extends BaseRepository implements Platf
$this->pushCriteria(app(RequestCriteria::class)); $this->pushCriteria(app(RequestCriteria::class));
} }
public function getCustomerList($offset,$limit) public function getCustomerList($where,$offset,$limit)
{ {
$customerInfo = DB::connection($this->getConnectionName())->table($this->getTableName()) $customerInfo = DB::connection($this->getConnectionName())->table($this->getTableName())
->where($where)
->offset($offset) ->offset($offset)
->limit($limit) ->limit($limit)
->get(); ->get();
......
...@@ -100,10 +100,17 @@ class CustomerService ...@@ -100,10 +100,17 @@ class CustomerService
$limit = $pageNo == 1 ? 0 : $pageNo * $offset; $limit = $pageNo == 1 ? 0 : $pageNo * $offset;
$customerRepository = app(PlatformCustomerRepository::class); $customerRepository = app(PlatformCustomerRepository::class);
$customerList = $customerRepository->getCustomerList($limit,$offset);
$where = [];
if(isset($requestParams['customer_no']) && !empty($requestParams['customer_no'])){
$where = [
'cus_number' => $requestParams['customer_no']
];
}
$customerList = $customerRepository->getCustomerList($where,$limit,$offset);
//获取订单量总数 //获取订单量总数
$total = $customerRepository->count(); $total = $customerRepository->count($where);
$dataReturn = []; $dataReturn = [];
$dataReturn['data'] = app(CustomersTransformer::class)->transform($customerList); $dataReturn['data'] = app(CustomersTransformer::class)->transform($customerList);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment