123456789101112131415161718192021222324252627 |
- <?php namespace Seller\Lib;
- use Dever;
- use Dever\Helper\Str;
- use Manage\Lib\Auth;
- class Manage extends Auth
- {
- # 获取商户列表
- public function getInfo()
- {
- return Dever::db('info', 'seller')->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);
- }
- }
- }
|