Commit d9a33cdc authored by clone's avatar clone

1

parent bb84d4e3
...@@ -262,12 +262,15 @@ class DailyPaper extends Basic ...@@ -262,12 +262,15 @@ class DailyPaper extends Basic
if (file_put_contents($url, $img)) { if (file_put_contents($url, $img)) {
$img_url = IMAGES_URL . $url; $img_url = IMAGES_URL . $url;
$m_daily = new ODaily(); $m_daily = new ODaily();
$m_daily->updateDaily(["id"=>$daily_id],["back_‭img"=>$img_url]); $update_where["id"] = $daily_id;
} else{ $update_params["back_‭img"] = $img_url;
$update_params["update_time"] = date("Y-m-d H:i:s", time());
$m_daily->updateDaily($update_where, $update_params);
} else {
return $this->response("101", "生成图片失败"); return $this->response("101", "生成图片失败");
} }
return $this->response("200", "success", ['img_url'=> $img_url]); return $this->response("200", "success", ['img_url' => $img_url]);
} }
} }
\ No newline at end of file
...@@ -84,7 +84,7 @@ class ODaily extends BaseModel ...@@ -84,7 +84,7 @@ class ODaily extends BaseModel
{ {
Db::startTrans(); Db::startTrans();
try { try {
$this->where($where)->update($params); $this->db_->where($where)->update($params);
Db::commit(); Db::commit();
return 1; return 1;
} catch (\Exception $e) { } catch (\Exception $e) {
......
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