|
|
@@ -8,9 +8,33 @@ Class OracleBasCustomerService
|
|
|
{
|
|
|
/** @var CacheService $cacheService */
|
|
|
private $cacheService;
|
|
|
+
|
|
|
function __construct(){
|
|
|
$this->cacheService=app('CacheService');
|
|
|
}
|
|
|
+
|
|
|
+ public function get(array $params){
|
|
|
+ $query = $this->query($params);
|
|
|
+ return $query->get();
|
|
|
+ }
|
|
|
+ public function first(array $params){
|
|
|
+ return $this->query($params)->first();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function count(array $params){
|
|
|
+ $query = $this->query($params);
|
|
|
+ return $query->count();
|
|
|
+ }
|
|
|
+
|
|
|
+ private function query(array $params){
|
|
|
+ $query = OracleBasCustomer::query();
|
|
|
+ foreach ($params as $column => $value){
|
|
|
+ if (is_array($value))$query->whereIn($column,$value);
|
|
|
+ else $query->where($column,$value);
|
|
|
+ }
|
|
|
+ return $query;
|
|
|
+ }
|
|
|
+
|
|
|
public function getWareHouse($customerIDs = null)
|
|
|
{
|
|
|
if(!$customerIDs){
|