| xqd
@@ -3,10 +3,13 @@
|
|
|
namespace App\Http\Controllers\Api\V1;
|
|
|
|
|
|
use App\Models\CommentInfoModel;
|
|
|
+use App\Models\DreamInfoModel;
|
|
|
use App\Models\InteractionInfo;
|
|
|
use App\Models\ReplyCommentsInfo;
|
|
|
use App\Models\SystemInfoModel;
|
|
|
use App\Models\UserCareDream;
|
|
|
+use App\Models\UserCareUser;
|
|
|
+use App\Models\UserInfoModel;
|
|
|
use Illuminate\Http\Request;
|
|
|
use App\Services\Base\ErrorCode;
|
|
|
use App\Helper\JpushHelper;
|
| xqd
@@ -75,6 +78,9 @@ class InteractionController extends Controller
|
|
|
if ($ok) {
|
|
|
// 收藏梦想最新动态加一
|
|
|
UserCareDream::where('dream_id',$dream_id)->increment('interaction_number',1);
|
|
|
+ $dream_user_id = DreamInfoModel::find($dream_id)->user_id;
|
|
|
+ UserCareUser::where('other_user_id',$dream_user_id)->update(['dream_id'=>$dream_id,'dream_number','1']);
|
|
|
+// UserCareUser::where('dream_id',$dream_id)->increment('interaction_number',1);
|
|
|
return $this->api('');
|
|
|
}else{
|
|
|
return $this->error(ErrorCode::SAVE_USER_FAILED);
|
| xqd
@@ -90,6 +96,7 @@ class InteractionController extends Controller
|
|
|
* @apiPermission Passport
|
|
|
* @apiVersion 0.1.0
|
|
|
* @apiParam {int} id 动态ID不存在
|
|
|
+ * @apiParam {int} [comment_user_id] //已经评论者id
|
|
|
* @apiParam {string} content 内容不能为空
|
|
|
* @apiSuccessExample {json} Success-Response:
|
|
|
* HTTP/1.1 200 OK
|
| xqd
@@ -133,9 +140,17 @@ class InteractionController extends Controller
|
|
|
$is_read = 1;
|
|
|
$data = compact('user_id','user_avatar','user_nickname','interaction_id','content','is_read');*/
|
|
|
|
|
|
- $data['to_user_id'] = InteractionInfo::find($request->id)->dream->user_id;
|
|
|
- $data['to_user_avatar'] = InteractionInfo::find($request->id)->dream->user_avatar;
|
|
|
- $data['to_user_nickname'] = InteractionInfo::find($request->id)->dream->user_nickname;
|
|
|
+// $data['to_user_id'] = InteractionInfo::find($request->id)->dream->user_id;
|
|
|
+// $data['to_user_avatar'] = InteractionInfo::find($request->id)->dream->user_avatar;
|
|
|
+// $data['to_user_nickname'] = InteractionInfo::find($request->id)->dream->user_nickname;
|
|
|
+ if (!empty($request->input('comment_user_id'))) {
|
|
|
+ $to_user = UserInfoModel::find($request->input('comment_user_id'));
|
|
|
+ if (!empty($to_user)){
|
|
|
+ $data['comment_info_id'] = $request->input('comment_user_id');
|
|
|
+ $data['to_user_avatar'] = $to_user->avatar;
|
|
|
+ $data['to_user_nickname'] = $to_user->nickname;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
$data['user_id'] = $user->id;
|
|
|
$data['user_avatar'] =$user->avatar;
|