1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Ksh
- * Date: 2017/6/26
- * Time: 11:12
- */
- namespace api\oa\controller;
- use think\Db;
- class OaAgentController extends OacallbackController {
- function _initialize() {
- parent::_initialize();
- $this->checkParam();
- $pwd = 'oa313';
- if ($this->param['type'] == 'promoter') {
- $_rs = $this->oa2addSub(
- $this->param['legion_name'], $this->param['username'], $this->param['agent_name'],
- $pwd.$this->param['agent_name']
- );
- } else {
- $_rs = $this->oa2AddAgent(
- $this->param['username'], $this->param['agent_name'], $pwd.$this->param['agent_name']
- );
- }
- return $_rs;
- }
- public function index() {
- }
- function checkParam() {
- $this->checkType();
- $this->checkUsername();
- $this->agentName();
- }
- function checkType() {
- }
- function checkUsername() {
- }
- function agentName() {
- }
- public function oa2AddAgent($user_nicename, $user_login, $user_pass) {
- $_oa_agent_class = new \huolib\oa\OaAgent();
- $_oa_agent_class->oa2AddAgent($user_nicename, $user_login, $user_pass);
- }
- public function oa2addSub($_legion_name, $user_nicename, $user_login, $user_pass) {
- $_oa_agent_class = new \huolib\oa\OaAgent();
- $_oa_agent_class->oa2addSub($_legion_name, $user_nicename, $user_login, $user_pass);
- }
- }
|