|
@@ -13,48 +13,8 @@ class Topicdongtai extends Api
|
|
|
protected $noNeedLogin = ['info','floor_info','topic_list'];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
|
|
|
- //发布动态
|
|
|
- public function addone(){
|
|
|
- $content = input('content','');
|
|
|
- $images = input('images','');
|
|
|
- $topic_id = input('topic_id','');
|
|
|
- if(!$content && !$images){
|
|
|
- $this->error(__('Invalid parameters'));
|
|
|
- }
|
|
|
-
|
|
|
- //关键字替换
|
|
|
- $content = Keyworld::sensitive($content);
|
|
|
-
|
|
|
- $data = [
|
|
|
- 'topic_id' => $topic_id,
|
|
|
- 'user_id' => $this->auth->id,
|
|
|
- 'content' => $content,
|
|
|
- 'images' => $images,
|
|
|
- 'longitude' => input('longitude',''),
|
|
|
- 'latitude' => input('latitude',''),
|
|
|
- 'createtime' => time(),
|
|
|
- 'updatetime' => time(),
|
|
|
- ];
|
|
|
|
|
|
|
|
|
- Db::startTrans();
|
|
|
- $id = Db::name('topic_dongtai')->insertGetId($data);
|
|
|
- //圈子新增一个贴
|
|
|
- $rs = Db::name('topic_hub')->where('id',$topic_id)->setInc('t_number');
|
|
|
-
|
|
|
- //tag任务赠送金币
|
|
|
- //发动态奖励
|
|
|
- $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,16);
|
|
|
- if($task_rs === false){
|
|
|
- Db::rollback();
|
|
|
- $this->error('完成任务赠送奖励失败');
|
|
|
- }
|
|
|
-
|
|
|
- Db::commit();
|
|
|
-
|
|
|
- $this->success('success',$id);
|
|
|
- }
|
|
|
-
|
|
|
//自己看列表
|
|
|
//某用户的帖子列表
|
|
|
public function my_lists(){
|
|
@@ -410,13 +370,6 @@ class Topicdongtai extends Api
|
|
|
$this->error('您的网络开小差啦~');
|
|
|
}
|
|
|
}
|
|
|
- //tag任务赠送金币
|
|
|
- //发动态奖励
|
|
|
-// $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,16);
|
|
|
-// if($task_rs === false){
|
|
|
-// Db::rollback();
|
|
|
-// $this->error('完成任务赠送奖励失败');
|
|
|
-// }
|
|
|
|
|
|
Db::commit();
|
|
|
|