作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

合并分支 'liuzhen' 到 'master'

商圈接口调试



查看合并请求 !81
... ... @@ -383,6 +383,7 @@ class Hot extends Api
'user_id' => $this->auth->id,
'object_id' => $store['id'],
'object_user_id' => $store['user_id'],
'type' => 2
];
$msg = $msg_model->where($where_m)->find();
if($msg) {
... ...
... ... @@ -304,23 +304,7 @@ class House extends Api
->order('createtime desc')
->select();
if($type == 1) {
//查出该用户已绑定的和申请中的小区
$user_house = Db::name('user_house')
->where('user_id',$user_id)
->select();
foreach ($data as &$v){
$v['shen_status'] = 0;
foreach ($user_house as &$val){
if($v['id'] == $val['house_id']){
$v['shen_status'] = $val['status'];
}else{
$v['shen_status'] = 0;
}
}
}
} else {
if($type == 2) {
//查出该用户入驻商家已绑定的和申请中的小区
$store_model = new \app\api\model\Store();
$where_s = ['user_id'=>$this->auth->id];
... ... @@ -337,6 +321,22 @@ class House extends Api
$v['shen_status'] = 0;
}
}
} else {
//查出该用户已绑定的和申请中的小区
$user_house = Db::name('user_house')
->where('user_id',$user_id)
->select();
foreach ($data as &$v){
$v['shen_status'] = 0;
foreach ($user_house as &$val){
if($v['id'] == $val['house_id']){
$v['shen_status'] = $val['status'];
}else{
$v['shen_status'] = 0;
}
}
}
}
$this->success('success',$data);
}
... ...
... ... @@ -1017,10 +1017,23 @@ class Store extends Api
"list": [
{
"id": 1,
"name": "行业名称",
"weigh": 0,
"user_id": 1,
"object_id": 1,
"object_user_id": 1,
"type": 1,
"content": "123132132",
"image": "",
"is_read_object": 是否已读1=是2=否,
"createtime": "2020-08-30 09:37:47",
"updatetime": 1598754989,
"user_info": {
"id": 1,
"username": "admin"
}
]
}
],
"this_page": 当前页数,
"total_page": 总页数
}
})
*/
... ... @@ -1031,7 +1044,7 @@ class Store extends Api
$store = $this->get_store();
$page = $param['page'];
$where = [
'where' => ['object_id'=>$store['id'],'object_user_id'=>$this->auth->id],
'where' => ['object_id'=>$store['id'],'object_user_id'=>$this->auth->id,'type'=>2],
'with' => ['user_info']
];
$order = ['createtime'=>'DESC'];
... ... @@ -1064,13 +1077,41 @@ class Store extends Api
'code':'1',
'msg':'返回成功',
"data": {
"comment": [
"list": [
{
"id": 2,
"user_id": 1,
"store_id": 1,
"store_user_id": 1,
"type": 2,
"content": "消息文字内容",
"image": "消息图片",
"createtime": "2020-08-28 14:09:50",
"user": {
"id": 1,
"name": "行业名称",
"weigh": 0,
"nickname": "发送人昵称",
"avatar": "头像",
"image_arr": []
}
]
},
{
"id": 1,
"user_id": 1,
"store_id": 1,
"store_user_id": 1,
"type": 1,
"content": "消息文字内容",
"image": "消息图片",
"createtime": "2020-08-28 13:36:30",
"user": {
"id": 1,
"nickname": "发送人昵称",
"avatar": "头像",
}
}
],
"this_page": 当前页数,
"total_page": 总页数
}
})
*/
... ... @@ -1104,7 +1145,7 @@ class Store extends Api
$user = $user_model->field('id,nickname,avatar')->where('id',$v['user_id'])->find();
$user['avatar'] = cdnurl($user['avatar']);
} else {
$user = $this->store_model->field('id,store_name as nickname,store_icon as avatar')->where('id',$v['house_user_id'])->find();
$user = $this->store_model->field('id,store_name as nickname,store_icon as avatar')->where('id',$v['store_id'])->find();
$user['avatar'] = cdnurl($user['avatar']);
}
$v['user'] = $user;
... ... @@ -1207,6 +1248,7 @@ class Store extends Api
'code':'1',
'msg':'返回成功',
"data": {
"score": 板币余额,
"list": [
{
"id": 1,
... ... @@ -1226,6 +1268,7 @@ class Store extends Api
];
$deposit = $this->deposit_model->selectOrFail($where,false,'*','weigh');
$return = [
'score' => $this->auth->score,
'list' => $deposit,
];
$this->success('请求成功',$return);
... ... @@ -1320,11 +1363,18 @@ class Store extends Api
"data": {
"list": [
{
"id": 1,
"name": "行业名称",
"weigh": 0,
"id": 3,
"user_id": 1,
"score": 5800,
"before": 10000,
"after": 4200,
"memo": "发布信息",
"status": 为0不显示(1=审核中,2=审核通过,3=审核失败),
"createtime": "2020-08-30 10:17:05",
}
]
],
"this_page": 当前页数,
"total_page": 总页数
}
})
*/
... ... @@ -1335,8 +1385,7 @@ class Store extends Api
$store = $this->get_store();
$page = $param['page'];
$where = [
'where' => ['store_id'=>$store['id']],
'with' => ['user_info']
'where' => ['user_id'=>$this->auth->id],
];
$order = ['createtime'=>'DESC'];
$model = new UserScoreLog();
... ...
... ... @@ -7,4 +7,8 @@ namespace app\api\model;
class Message extends Base
{
public function getCreatetimeAttr($value)
{
return date('Y-m-d H:i:s',$value);
}
}
\ No newline at end of file
... ...
... ... @@ -4,4 +4,19 @@ namespace app\api\model;
class User extends Base{
/**
* 获取头像
* @param string $value
* @param array $data
* @return string
*/
public function getAvatarAttr($value, $data)
{
if (!$value) {
//如果不需要启用首字母头像,请使用
$value = '/assets/img/avatar.png';
// $value = letter_avatar($data['nickname']);
}
return cdnurl($value);
}
}
... ...
... ... @@ -4,4 +4,8 @@ namespace app\api\model;
class UserScoreLog extends Base{
public function getCreatetimeAttr($value)
{
return date('Y-m-d H:i:s',$value);
}
}
... ...