作者 王智

baoxiu

@@ -174,4 +174,30 @@ class Common extends Api @@ -174,4 +174,30 @@ class Common extends Api
174 $this->error('失败', 0); 174 $this->error('失败', 0);
175 } 175 }
176 } 176 }
  177 +
  178 +
  179 + public function AddUser()
  180 + {
  181 +// $osn = rand(100000, 999999);
  182 + $is_user = Db::name('user')->order('id desc')->limit(1)->value('username');
  183 + if (empty($is_user)) {
  184 + $params['username'] = '100000';
  185 + $params['password'] = 123456;
  186 + } else {
  187 + $params['username'] = $is_user + 1;
  188 + $params['password'] = 123456;
  189 + }
  190 + for ($i = 1; $i < 30; $i++) {
  191 + $data = [
  192 + 'username' => $params['username'],
  193 + 'password' => $params['password'],
  194 + 'zhandian_id' => 16,
  195 + 'level' => 4,
  196 + 'name' => '维修成员' . $i,
  197 + 'createtime' => time(),
  198 + 'updatetime' => time()
  199 + ];
  200 + Db::name('user')->insert($data);
  201 + }
  202 + }
177 } 203 }