Commit 4ede0d24 authored by sugar's avatar sugar

热更新

parent 444976a9
Pipeline #712 canceled with stages
......@@ -11,6 +11,7 @@ use app\api\model\Addr;
use app\api\model\FriendCommentModel;
use app\api\model\FriendLikeModel;
use app\api\model\HotcircleModel;
use app\api\model\JoinCircle;
use app\common\controller\Api;
use fast\Tree;
use think\Db;
......@@ -41,24 +42,40 @@ class Friend extends Api{
}
/**
* 热门圈子列表
* 我的圈子列表
*/
public function getMyCircles(){
$page = $this->request->post('page',1);
$type = $this->request->post('type','');//my_circle:我的圈子
$where = ['status' =>1];
$where = ['hc.status' =>1,'jc,status' =>1];
if($type == 'my_circle'){
$where['user_id'] = $this->auth->id;
$where['jc.user_id'] = $this->auth->id;
}
$list = HotcircleModel::alais('hc')
->join('join_circle jc','hc.id=jc.hot_circle_id')
->where($where)
->page($page)
->limit($this->pageSize)
->field('hc.*,jc.hot_circle_id')
->select();
$this->success('获取成功',['list' =>$list]);
}
/**
* 加入圈子
*/
public function joinCircle(){
$hot_circle_id = $this->request->post('hot_circle_id',1);
$data = [
'user_id' =>$this->auth->id,
'hot_circle_id' =>$hot_circle_id,
'status' =>1,
'create_time' =>time(),
];
$res= JoinCircle::create($data);
$this->success('获取成功',$res->id);
}
/**
* 发布朋友圈
* @param content 朋友圈信息
......
<?php
/**
* Created by PhpStorm.
* User: pc
* Date: 2023/8/21
* Time: 14:41
*/
namespace app\api\model;
use think\Model;
class JoinCircle extends Model
{
// 表名
protected $name = 'join_circle';
// 自动写入时间戳字段
protected $autoWriteTimestamp = false;
// 追加属性
protected $append = [
];
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment