Mem.php 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <?php
  2. /**
  3. * Mem.php UTF-8
  4. * 玩家信息
  5. *
  6. * @date : 2018/1/19 15:39
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace huo\controller\request;
  13. class Mem {
  14. private $creator = ''; /* 账号创建方 */
  15. private $is_reg = 0; /* 是否注册 1 注册 0 登陆 */
  16. private $mem_id = 0;/* 玩家ID */
  17. private $mg_mem_id = 0;/* 游戏玩家ID */
  18. private $username = ''; /* 用户名 */
  19. private $nickname = ''; /* 昵称 */
  20. private $mobile_prefix = ''; /* 国别 */
  21. private $reg_mobile = ''; /* 注册手机号 */
  22. private $reg_email = ''; /* 注册邮箱 */
  23. private $password = ''; /* 密码 */
  24. private $pay_pwd = ''; /* 支付密码 */
  25. private $email = ''; /* 邮箱 */
  26. private $mobile = ''; /* 手机号 */
  27. private $from_device = ''; /* 设备来源 */
  28. private $device_id = ''; /* 设备ID android 为imei ios 为idfa */
  29. private $app_id = ''; /* 注册游戏ID */
  30. private $agent_id = 0; /* 注册渠道ID */
  31. private $origin_agent_id = 0; /* 原始渠道ID */
  32. private $agent_game = ''; /* 注册渠道游戏名称 */
  33. private $status = 2; /* 状态 1 为试玩状态 2为正常状态,3为冻结状态 */
  34. private $is_switch = 2; /* 切换状态 1 为切换 2为不切换 */
  35. private $reg_ip = ''; /* 注册IP */
  36. private $avatar = ''; /* 头像 */
  37. private $parent_mem_id = 0; /* 父玩家ID */
  38. private $reg_time = 0; /* 注册时间 */
  39. private $login_time = 0; /* 登陆时间 */
  40. public function __construct($data = []) {
  41. if (!empty($data)) {
  42. $this->setData($data);
  43. }
  44. }
  45. /**
  46. * 设置数据
  47. *
  48. * @param array $data
  49. */
  50. public function setData($data = []) {
  51. if (empty($data)) {
  52. return;
  53. }
  54. $this->setUsername(get_val($data, 'username'));
  55. $this->setPassword(get_val($data, 'password'));
  56. }
  57. /**
  58. * @return string
  59. */
  60. public function getCreator() {
  61. return $this->creator;
  62. }
  63. /**
  64. * @param string $creator
  65. */
  66. public function setCreator($creator) {
  67. $this->creator = $creator;
  68. }
  69. /**
  70. * @return int
  71. */
  72. public function getIsReg() {
  73. return $this->is_reg;
  74. }
  75. /**
  76. * @param int $is_reg
  77. */
  78. public function setIsReg($is_reg) {
  79. $this->is_reg = $is_reg;
  80. }
  81. /**
  82. * @return int
  83. */
  84. public function getMemId() {
  85. return $this->mem_id;
  86. }
  87. /**
  88. * @param int $mem_id
  89. */
  90. public function setMemId($mem_id) {
  91. $this->mem_id = $mem_id;
  92. }
  93. /**
  94. * @return int
  95. */
  96. public function getMgMemId() {
  97. return $this->mg_mem_id;
  98. }
  99. /**
  100. * @param int $mg_mem_id
  101. */
  102. public function setMgMemId($mg_mem_id) {
  103. $this->mg_mem_id = $mg_mem_id;
  104. }
  105. /**
  106. * @return string
  107. */
  108. public function getUsername() {
  109. return $this->username;
  110. }
  111. /**
  112. * @param string $username
  113. */
  114. public function setUsername($username) {
  115. $this->username = $username;
  116. }
  117. /**
  118. * @return string
  119. */
  120. public function getNickname() {
  121. return $this->nickname;
  122. }
  123. /**
  124. * @param string $nickname
  125. */
  126. public function setNickname($nickname) {
  127. $this->nickname = $nickname;
  128. }
  129. /**
  130. * @return string
  131. */
  132. public function getMobilePrefix() {
  133. return $this->mobile_prefix;
  134. }
  135. /**
  136. * @param string $mobile_prefix
  137. */
  138. public function setMobilePrefix($mobile_prefix) {
  139. $this->mobile_prefix = $mobile_prefix;
  140. }
  141. /**
  142. * @return string
  143. */
  144. public function getRegMobile() {
  145. return $this->reg_mobile;
  146. }
  147. /**
  148. * @param string $reg_mobile
  149. */
  150. public function setRegMobile($reg_mobile) {
  151. $this->reg_mobile = $reg_mobile;
  152. }
  153. /**
  154. * @return string
  155. */
  156. public function getRegEmail() {
  157. return $this->reg_email;
  158. }
  159. /**
  160. * @param string $reg_email
  161. */
  162. public function setRegEmail($reg_email) {
  163. $this->reg_email = $reg_email;
  164. }
  165. /**
  166. * @return string
  167. */
  168. public function getPassword() {
  169. return $this->password;
  170. }
  171. /**
  172. * @param string $password
  173. */
  174. public function setPassword($password) {
  175. $this->password = $password;
  176. }
  177. /**
  178. * @return string
  179. */
  180. public function getPayPwd() {
  181. return $this->pay_pwd;
  182. }
  183. /**
  184. * @param string $pay_pwd
  185. */
  186. public function setPayPwd($pay_pwd) {
  187. $this->pay_pwd = $pay_pwd;
  188. }
  189. /**
  190. * @return string
  191. */
  192. public function getEmail() {
  193. return $this->email;
  194. }
  195. /**
  196. * @param string $email
  197. */
  198. public function setEmail($email) {
  199. $this->email = $email;
  200. }
  201. /**
  202. * @return string
  203. */
  204. public function getMobile() {
  205. return $this->mobile;
  206. }
  207. /**
  208. * @param string $mobile
  209. */
  210. public function setMobile($mobile) {
  211. $this->mobile = $mobile;
  212. }
  213. /**
  214. * @return string
  215. */
  216. public function getFromDevice() {
  217. return $this->from_device;
  218. }
  219. /**
  220. * @param string $from_device
  221. */
  222. public function setFromDevice($from_device) {
  223. $this->from_device = $from_device;
  224. }
  225. /**
  226. * @return string
  227. */
  228. public function getDeviceId() {
  229. return $this->device_id;
  230. }
  231. /**
  232. * @param string $device_id
  233. */
  234. public function setDeviceId($device_id) {
  235. $this->device_id = $device_id;
  236. }
  237. /**
  238. * @return string
  239. */
  240. public function getAppId() {
  241. return $this->app_id;
  242. }
  243. /**
  244. * @param string $app_id
  245. */
  246. public function setAppId($app_id) {
  247. $this->app_id = $app_id;
  248. }
  249. /**
  250. * @return string
  251. */
  252. public function getAgentId() {
  253. return $this->agent_id;
  254. }
  255. /**
  256. * @param string $agent_id
  257. */
  258. public function setAgentId($agent_id) {
  259. $this->agent_id = $agent_id;
  260. }
  261. /**
  262. * @return string
  263. */
  264. public function getAgentGame() {
  265. return $this->agent_game;
  266. }
  267. /**
  268. * @param string $agent_game
  269. */
  270. public function setAgentGame($agent_game) {
  271. $this->agent_game = $agent_game;
  272. }
  273. /**
  274. * @return string
  275. */
  276. public function getStatus() {
  277. return $this->status;
  278. }
  279. /**
  280. * @param string $status
  281. */
  282. public function setStatus($status) {
  283. $this->status = $status;
  284. }
  285. /**
  286. * @return string
  287. */
  288. public function getSwitch() {
  289. return $this->is_switch;
  290. }
  291. /**
  292. * @param string $is_switch
  293. */
  294. public function setSwitch($is_switch) {
  295. $this->is_switch = $is_switch;
  296. }
  297. /**
  298. * @return string
  299. */
  300. public function getRegIp() {
  301. return $this->reg_ip;
  302. }
  303. /**
  304. * @param string $reg_ip
  305. */
  306. public function setRegIp($reg_ip) {
  307. $this->reg_ip = $reg_ip;
  308. }
  309. /**
  310. * @return string
  311. */
  312. public function getAvatar() {
  313. return $this->avatar;
  314. }
  315. /**
  316. * @param string $avatar
  317. */
  318. public function setAvatar($avatar) {
  319. $this->avatar = $avatar;
  320. }
  321. /**
  322. * @return int
  323. */
  324. public function getParentMemId() {
  325. return $this->parent_mem_id;
  326. }
  327. /**
  328. * @param int $parent_mem_id
  329. */
  330. public function setParentMemId($parent_mem_id) {
  331. $this->parent_mem_id = $parent_mem_id;
  332. }
  333. public function toArray() {
  334. $_data['username'] = $this->getUsername();
  335. $_data['nickname'] = $this->getNickname();
  336. $_data['nickname'] = empty($_data['nickname']) ? $this->getUsername() : $this->getNickname();
  337. $_data['reg_mobile'] = $this->getRegMobile();
  338. $_data['reg_email'] = $this->getRegEmail();
  339. $_data['password'] = $this->getPassword();
  340. $_data['pay_pwd'] = $this->getPassword();
  341. $_data['email'] = $this->getEmail();
  342. $_data['mobile'] = $this->getMobile();
  343. $_data['from_device'] = $this->getFromDevice();
  344. $_data['device_id'] = $this->getDeviceId();
  345. $_data['app_id'] = $this->getAppId();
  346. $_data['agent_id'] = $this->getAgentId();
  347. $_data['agent_game'] = $this->getAgentGame();
  348. $_data['status'] = $this->getStatus();
  349. $_data['is_switch'] = $this->getSwitch();
  350. $_data['reg_ip'] = $this->getRegIp();
  351. $_data['avatar'] = $this->getAvatar();
  352. $_data['parent_mem_id'] = $this->getParentMemId();
  353. return $_data;
  354. }
  355. /**
  356. * @return int
  357. */
  358. public function getRegTime() {
  359. return $this->reg_time;
  360. }
  361. /**
  362. * @param int $reg_time
  363. */
  364. public function setRegTime($reg_time) {
  365. $this->reg_time = $reg_time;
  366. }
  367. /**
  368. * @return int
  369. */
  370. public function getLoginTime() {
  371. return $this->login_time;
  372. }
  373. /**
  374. * @param int $login_time
  375. */
  376. public function setLoginTime($login_time) {
  377. $this->login_time = $login_time;
  378. }
  379. /**
  380. * @return int
  381. */
  382. public function getOriginAgentId() {
  383. return $this->origin_agent_id;
  384. }
  385. /**
  386. * @param int $origin_agent_id
  387. */
  388. public function setOriginAgentId($origin_agent_id) {
  389. $this->origin_agent_id = $origin_agent_id;
  390. }
  391. }