|
|
@@ -58,9 +58,9 @@ class MeetingService extends BaseService
|
|
|
* @param int $userId
|
|
|
* @return array|mixed
|
|
|
*/
|
|
|
- public function getInfo($id,$userId=0)
|
|
|
+ public function getInfo($id,$userId=0,$type=1)
|
|
|
{
|
|
|
- $cacheKey = "caches:meeting:info_{$id}_{$userId}";
|
|
|
+ $cacheKey = "caches:meeting:info_{$id}_{$userId}_{$type}";
|
|
|
$info = RedisService::get($cacheKey);
|
|
|
if($info){
|
|
|
return $info;
|
|
|
@@ -71,39 +71,42 @@ class MeetingService extends BaseService
|
|
|
->first();
|
|
|
$info = $info? $info->toArray() : [];
|
|
|
if($info){
|
|
|
- $info['qrcode'] = MpService::make()->getMiniQrcode('pagesSub/pages/meeting/books',$id);
|
|
|
- $info['qrcode'] = $info['qrcode']? get_image_url($info['qrcode']):'';
|
|
|
+ if($type == 2){
|
|
|
+ $info['qrcode'] = MpService::make()->getMiniQrcode('pagesSub/pages/meeting/books',$id);
|
|
|
+ $info['qrcode'] = $info['qrcode']? get_image_url($info['qrcode']):'';
|
|
|
+ }else{
|
|
|
+ $areaIds = [];
|
|
|
+ if($info['city_id']){
|
|
|
+ $areaIds[] = $info['city_id'];
|
|
|
+ }
|
|
|
|
|
|
- $areaIds = [];
|
|
|
- if($info['city_id']){
|
|
|
- $areaIds[] = $info['city_id'];
|
|
|
- }
|
|
|
+ if($info['district_id']){
|
|
|
+ $areaIds[] = $info['district_id'];
|
|
|
+ }
|
|
|
|
|
|
- if($info['district_id']){
|
|
|
- $areaIds[] = $info['district_id'];
|
|
|
- }
|
|
|
+ $areas = CityModel::whereIn('citycode', $areaIds)->pluck('name');
|
|
|
+ $areas = $areas?$areas->toArray() :[];
|
|
|
+ $info['area'] = $areas? implode('/',$areas) : '';
|
|
|
+ $stores = '';
|
|
|
+ if($info['store_ids']){
|
|
|
+ $stores = UserModel::whereIn('id', $info['store_ids'])
|
|
|
+ ->select(['id','avatar','realname','nickname as company','mobile','department','position','status'])
|
|
|
+ ->where(['mark'=>1])
|
|
|
+ ->get();;
|
|
|
+ }
|
|
|
|
|
|
- $areas = CityModel::whereIn('citycode', $areaIds)->pluck('name');
|
|
|
- $areas = $areas?$areas->toArray() :[];
|
|
|
- $info['area'] = $areas? implode('/',$areas) : '';
|
|
|
- $stores = '';
|
|
|
- if($info['store_ids']){
|
|
|
- $stores = UserModel::whereIn('id', $info['store_ids'])
|
|
|
- ->select(['id','avatar','realname','nickname as company','mobile','department','position','status'])
|
|
|
- ->where(['mark'=>1])
|
|
|
- ->get();;
|
|
|
+ $info['stores'] = $stores?$stores->toArray() : [];
|
|
|
+ $supervisors = '';
|
|
|
+ if($info['supervisor_ids']){
|
|
|
+ $supervisors = SupervisorsModel::whereIn('id', $info['supervisor_ids'])
|
|
|
+ ->select(['id','name','avatar','mobile','company','occupation','department','position','status'])
|
|
|
+ ->where(['mark'=>1])
|
|
|
+ ->get();
|
|
|
+ }
|
|
|
+ $info['supervisors'] = $supervisors?$supervisors->toArray() :[];
|
|
|
+ $info['guest_count'] = count($info['stores']) + count($info['supervisors']);
|
|
|
}
|
|
|
|
|
|
- $info['stores'] = $stores?$stores->toArray() : [];
|
|
|
- $supervisors = '';
|
|
|
- if($info['supervisor_ids']){
|
|
|
- $supervisors = SupervisorsModel::whereIn('id', $info['supervisor_ids'])
|
|
|
- ->select(['id','name','avatar','mobile','company','occupation','department','position','status'])
|
|
|
- ->where(['mark'=>1])
|
|
|
- ->get();
|
|
|
- }
|
|
|
- $info['supervisors'] = $supervisors?$supervisors->toArray() :[];
|
|
|
- $info['guest_count'] = count($info['stores']) + count($info['supervisors']);
|
|
|
RedisService::set($cacheKey, $info, rand(5,10));
|
|
|
}
|
|
|
|