|
...
|
...
|
@@ -40,17 +40,17 @@ class GoogleKeywordInsightLogic extends BaseLogic |
|
|
|
$this->service = new RapIdApIService();
|
|
|
|
$data = $this->service->requestUrl($this->param['keyword']);
|
|
|
|
if(!empty($data)){
|
|
|
|
// DB::beginTransaction();
|
|
|
|
DB::beginTransaction();
|
|
|
|
//保存数据库
|
|
|
|
// try {
|
|
|
|
try {
|
|
|
|
$detailModel = new GoogleKeywordInsightDetail();
|
|
|
|
$this->model->saveInsight($this->user['project_id'],$this->param['keyword'],$data);
|
|
|
|
$detailModel->saveInsightDetail($this->user['project_id'],$this->param['keyword'],$data);
|
|
|
|
// DB::commit();
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// DB::rollBack();
|
|
|
|
// $this->fail('保存失败,请联系管理员');
|
|
|
|
// }
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('保存失败,请联系管理员');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success();
|
...
|
...
|
|