...
|
...
|
@@ -287,38 +287,62 @@ class Store extends Api |
|
|
*/
|
|
|
public function detail()
|
|
|
{
|
|
|
$user_id = $this->getUserId();
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
//查询我的足迹
|
|
|
$foot = Db::name('footprint')->where('user_id',$user_id)->where('application_id',$id)->find();
|
|
|
if(empty($foot)){
|
|
|
$info['user_id'] = $user_id;
|
|
|
$info['application_id'] = $id;
|
|
|
$info['createtime'] = time();
|
|
|
Db::name('footprint')->insertGetId($info);
|
|
|
$token = $this->request->header('token');
|
|
|
if(empty($token)){
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$data = Db::name('application')
|
|
|
->where('id',$id)
|
|
|
->field('updatetime',true)
|
|
|
->find();
|
|
|
if(empty($data)){
|
|
|
$this->error('数据错误');
|
|
|
}
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data['yuan_image'] = $data['image'];
|
|
|
$data['image'] = $qiniu.$data['image'];
|
|
|
$data['lon'] = floatval($data['lon']);
|
|
|
$data['city_name'] = Db::name('area')->where('id',$data['city_id'])->value('name');
|
|
|
$data['type_name'] = Db::name('type')->where('id',$data['type_id'])->value('name');
|
|
|
$data['lat'] = floatval($data['lat']);
|
|
|
$data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
|
|
|
$this->success('success',$data);
|
|
|
}else{
|
|
|
$createtime = time();
|
|
|
Db::name('footprint')->where('id',$foot['id'])->update(['createtime'=>$createtime]);
|
|
|
}
|
|
|
$data = Db::name('application')
|
|
|
->where('id',$id)
|
|
|
->field('updatetime',true)
|
|
|
->find();
|
|
|
if(empty($data)){
|
|
|
$this->error('数据错误');
|
|
|
$user_id = $this->getUserId();
|
|
|
$id = $this->request->param('id');
|
|
|
if(empty($id)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
//查询我的足迹
|
|
|
$foot = Db::name('footprint')->where('user_id',$user_id)->where('application_id',$id)->find();
|
|
|
if(empty($foot)){
|
|
|
$info['user_id'] = $user_id;
|
|
|
$info['application_id'] = $id;
|
|
|
$info['createtime'] = time();
|
|
|
Db::name('footprint')->insertGetId($info);
|
|
|
}else{
|
|
|
$createtime = time();
|
|
|
Db::name('footprint')->where('id',$foot['id'])->update(['createtime'=>$createtime]);
|
|
|
}
|
|
|
$data = Db::name('application')
|
|
|
->where('id',$id)
|
|
|
->field('updatetime',true)
|
|
|
->find();
|
|
|
if(empty($data)){
|
|
|
$this->error('数据错误');
|
|
|
}
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data['yuan_image'] = $data['image'];
|
|
|
$data['image'] = $qiniu.$data['image'];
|
|
|
$data['lon'] = floatval($data['lon']);
|
|
|
$data['city_name'] = Db::name('area')->where('id',$data['city_id'])->value('name');
|
|
|
$data['type_name'] = Db::name('type')->where('id',$data['type_id'])->value('name');
|
|
|
$data['lat'] = floatval($data['lat']);
|
|
|
$data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
$qiniu = get_addon_config('qiniu')['cdnurl'];
|
|
|
$data['yuan_image'] = $data['image'];
|
|
|
$data['image'] = $qiniu.$data['image'];
|
|
|
$data['lon'] = floatval($data['lon']);
|
|
|
$data['city_name'] = Db::name('area')->where('id',$data['city_id'])->value('name');
|
|
|
$data['type_name'] = Db::name('type')->where('id',$data['type_id'])->value('name');
|
|
|
$data['lat'] = floatval($data['lat']);
|
|
|
$data['createtime'] = date('Y-m-d H:i:s',$data['createtime']);
|
|
|
$this->success('success',$data);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|