123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <?php
- namespace huo\controller\request;
- use ads\Agent;
- use huo\logic\agent\AgentGameLogic;
- class Channel {
- private $ch = '';
- private $sub_ch = '';
- private $agent_id = 0;
- private $agent_game = '';
- public function __construct($data = []) {
- if (!empty($data)) {
- $this->setData($data);
- }
- }
-
- public function setData($data = []) {
- if (empty($data)) {
- return;
- }
- $this->setAgentId(get_val($data, 'ch'));
-
- $_agent_game = get_val($data, 'sub_ch');
- $_agent_game_id = (new Agent())->getIdByCode($_agent_game);
- if (!empty($_agent_game_id)) {
- $_agent_game = (new AgentGameLogic())->getAgentGameById($_agent_game_id);
- }
- $this->setAgentGame($_agent_game);
- }
-
- public function getCh() {
- return $this->ch;
- }
-
- public function setCh($ch) {
- $this->ch = $ch;
- }
-
- public function getSubCh() {
- return $this->sub_ch;
- }
-
- public function setSubCh($sub_ch) {
- $this->sub_ch = $sub_ch;
- }
-
- public function getAgentId() {
- return $this->agent_id;
- }
-
- public function setAgentId($agent_id) {
- $this->agent_id = $agent_id;
- }
-
- public function getAgentGame() {
- return $this->agent_game;
- }
-
- public function setAgentGame($agent_game) {
- $this->agent_game = $agent_game;
- }
- public function toArray() {
-
- return [];
- }
- }
|