select(array('status' => 1))->fetchAll(); } # 为商户生成appkey public function createAppKey($data) { $info = Dever::db('info', 'seller')->find($data['id']); if (!$info['appkey']) { $update['appkey'] = 'app' . Str::rand(15, 0); $update['appsecret'] = strtoupper(Str::rand(32)); $check = Dever::db('info', 'seller')->find(array('appkey' => $update['appkey'])); if ($check) { return $this->createAppKey($data); } Dever::db('info', 'seller')->update($data['id'], $update); } } }