'单位', '2' => '云支付', '3' => '微信', '4' => '支付宝']; } public function getPayMethodTextAttr($value, $data) { $value = $value ? $value : $data['pay_method']; $list = $this->getPayMethodList(); return isset($list[$value]) ? $list[$value] : ''; } public function checkAgent($admin_id,$checkDis = true){ $group_id = model('AdminGroupAccess')->getGroupId($admin_id); if(!$checkDis && $group_id == AdminConstants::ADMIN_GROUP_ID_AGENT){ //不检查配号 return true; }else if($checkDis && $group_id == AdminConstants::ADMIN_GROUP_ID_AGENT){ //检查配号 $ex_info = $this->getInfo($admin_id); if(intval($ex_info['distribute'])){ return true; }else{ return false; } }else{ return false; } } public function getInfo($adminId){ $redis = Redis::instance(); $key = 'AE:'.$adminId; if($redis->exists($key)){ $info = $redis->hgetall($key); if (!array_key_exists('benefit_app', $info)) { $redis->del($key); return $this->getInfo($adminId); } }else{ $info = $this->where('admin_id',$adminId)->find(); if($info){ $info = $info->toArray(); $redis->hmset($key,$info); $redis->expire($key,86400); }else{ $info = null; } } return $info; } /** * 获取对应的渠道 * @param $channel_id * @return mixed */ public function getChannelId($channel_id) { $adminInfo = $this->getInfo($channel_id); if ($adminInfo['distribute']) { return $adminInfo['create_by']; } else { return $adminInfo['admin_id']; } } }