total($where); } # 提交分享 public function submit($uid, $id, $type) { $where['uid'] = $uid; $where['data_id'] = $id; $where['type'] = $type; $info = Dever::db('act/share')->one($where); if (!$info) { $where['num'] = 1; Dever::db('act/share')->insert($where); } else { $where['num'] = $info['num'] + 1; $where['where_id'] = $info['id']; Dever::db('act/share')->update($where); } return true; } # 回流 public function submit_reflux($source_uid, $uid, $id, $type) { $where['source_uid'] = $source_uid; $where['uid'] = $uid; if ($where['source_uid'] == $where['uid']) { //return false; } $where['data_id'] = $id; $where['type'] = $type; $share = Dever::db('act/share')->one($where); if ($share) { $where['share_id'] = $share['id']; $info = Dever::db('act/share_reflux')->one($where); if (!$info) { Dever::db('act/share_reflux')->insert($where); return true; } } return false; } }