1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace User\Lib;
- use Dever;
- class Times
- {
- public function getData($uid, $id)
- {
- $where['info_id'] = $id;
- $where['uid'] = $uid;
- return Dever::db('user/times')->getData($where);
- }
- # 记录用户时光选择操作
- public function up($uid, $id, $times_id, $day)
- {
- $where['info_id'] = $id;
- $where['uid'] = $uid;
- $where['times_id'] = $times_id;
- $record = Dever::db('user/times')->one($where);
- if (!$day) {
- $where['day'] = 0;
- } else {
- $where['day'] = $day;
- }
-
- if ($record) {
- $where['where_id'] = $record['id'];
- Dever::db('user/times')->update($where);
- } else {
- Dever::db('user/times')->insert($where);
- }
- return 'yes';
- }
- }
|