|
@@ -220,15 +220,38 @@ class AccountService extends BaseService
|
|
|
* @param $type
|
|
* @param $type
|
|
|
* @return array|mixed
|
|
* @return array|mixed
|
|
|
*/
|
|
*/
|
|
|
- public function getPayMealList($type)
|
|
|
|
|
|
|
+ public function getPayMealList($params)
|
|
|
{
|
|
{
|
|
|
- $cacheKey = "caches:accounts:mealList_{$type}";
|
|
|
|
|
|
|
+ $type = isset($params['type'])?$params['type'] : 0;
|
|
|
|
|
+ $gasType = isset($params['gas_type'])?$params['gas_type'] : 0;
|
|
|
|
|
+ $phoneService = isset($params['phone_service'])?$params['phone_service'] : 0;
|
|
|
|
|
+ $phoneType = isset($params['phone_type'])?$params['phone_type'] : 0;
|
|
|
|
|
+ $electricType = isset($params['electric_type'])?$params['electric_type'] : 0;
|
|
|
|
|
+ $cacheKey = "caches:accounts:mealList_{$type}:".md5(json_encode($params));
|
|
|
$datas = RedisService::get($cacheKey);
|
|
$datas = RedisService::get($cacheKey);
|
|
|
if($datas){
|
|
if($datas){
|
|
|
return $datas;
|
|
return $datas;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $datas = PayMealsModel::where(['type'=>$type,'status'=>1,'mark'=>1])
|
|
|
|
|
|
|
+ $where = ['type'=>$type,'status'=>1,'mark'=>1];
|
|
|
|
|
+ if($type==1){
|
|
|
|
|
+ if($phoneType){
|
|
|
|
|
+ $where['phone_type'] = $phoneType;
|
|
|
|
|
+ }
|
|
|
|
|
+ if($phoneService){
|
|
|
|
|
+ $where['phone_service'] = $phoneService;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if($type==2){
|
|
|
|
|
+ if($electricType){
|
|
|
|
|
+ $where['electric_type'] = $electricType;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if($type==3){
|
|
|
|
|
+ if($gasType){
|
|
|
|
|
+ $where['gas_type'] = $gasType;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $datas = PayMealsModel::where($where)
|
|
|
->orderBy('sort','desc')
|
|
->orderBy('sort','desc')
|
|
|
->orderBy('id','asc')
|
|
->orderBy('id','asc')
|
|
|
->get();
|
|
->get();
|