|
|
@ -161,6 +161,7 @@ class ResourceLogic extends Logic |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$article['goodsType'] = $goodsType; |
|
|
$article['goodsType'] = $goodsType; |
|
|
|
|
|
$article['path'] = $article['path']?UrlServer::getFileUrl($article['path']):''; |
|
|
|
|
|
|
|
|
$article['address'] = $article['province_id']?AreaServer::getAddress([ |
|
|
$article['address'] = $article['province_id']?AreaServer::getAddress([ |
|
|
$article['province_id'], |
|
|
$article['province_id'], |
|
|
@ -171,4 +172,32 @@ class ResourceLogic extends Logic |
|
|
|
|
|
|
|
|
return $article; |
|
|
return $article; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Notes: 文章详细 |
|
|
|
|
|
* @Author: 张无忌 |
|
|
|
|
|
* @param $id |
|
|
|
|
|
* @return int |
|
|
|
|
|
*/ |
|
|
|
|
|
public static function downloadLog($id,$uid) |
|
|
|
|
|
{ |
|
|
|
|
|
$article = Resource::field('*')->where('id', $id)->findOrEmpty(); |
|
|
|
|
|
if($article->isEmpty()) { |
|
|
|
|
|
return 0; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$article->download = $article->download + 1; |
|
|
|
|
|
$article->save(); |
|
|
|
|
|
|
|
|
|
|
|
//下载记录 |
|
|
|
|
|
$userResource = []; |
|
|
|
|
|
$userResource['user_id'] = $uid; |
|
|
|
|
|
$userResource['resource_id'] = $id; |
|
|
|
|
|
$userResource['type'] = 0; |
|
|
|
|
|
$userResource['create_time'] = time(); |
|
|
|
|
|
$userResourceModel = new UserResource(); |
|
|
|
|
|
$userResourceModel->insert($userResource); |
|
|
|
|
|
return 1; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |