123456789101112131415161718192021222324252627282930313233 |
- <?php namespace Upload\Lib;
- use Dever;
- class Util
- {
- public function getGroup()
- {
- $data['key'] = Dever::input('group_key', 'is_string', '分组标识');
- $info = Dever::db('group', 'upload')->find($data);
- $data['name'] = Dever::input('group_name', 'is_string', '分组名称');
- if ($info) {
- Dever::db('group', 'upload')->update($info['id'], $data);
- $id = $info['id'];
- } else {
- $id = Dever::db('group', 'upload')->insert($data);
- }
- return $id;
- }
- public function getUser()
- {
- $data['token'] = Dever::input('user_token', 'is_string', '用户标识');
- $data['table'] = Dever::input('user_table', 'is_string', '用户表');
- $data['table_id'] = Dever::input('user_id', 'is_numeric', '用户ID');
- $info = Dever::db('user', 'upload')->find($data);
- if ($info) {
- Dever::db('user', 'upload')->update($info['id'], $data);
- $id = $info['id'];
- } else {
- $id = Dever::db('user', 'upload')->insert($data);
- }
- return $id;
- }
- }
|