| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Services;
- use App\OracleBasCustomer;
- Class OracleBasCustomerService
- {
- /** @var CacheService $cacheService */
- private $cacheService;
- function __construct(){
- $this->cacheService=app('CacheService');
- }
- public function getWareHouse($customerIDs = null)
- {
- if(!$customerIDs){
- return OracleBasCustomer::query()->where('Customer_Type','WH')->get();
- }
- return OracleBasCustomer::query()->where('Customer_Type','WH')->get();
- }
- public function getCustomers($codes)
- {
- return $this->cacheService->getOrExecute('OracleBasCustomersAll'.md5(json_encode($codes)),function()use($codes){
- return OracleBasCustomer::query()->select('customerid','descr_c')
- ->where('customer_type','OW')
- ->where('active_flag','Y')
- ->whereIn('customerid',$codes)
- ->get();
- },config('cache.expirations.owners'));
- }
- }
|