Commit 1b772e5b authored by zhuwei's avatar zhuwei

1

parent 00e699ec
......@@ -115,10 +115,13 @@ class Sublet extends Basic
$params["update_time"] = date("Y-m-d H:i:s", time());
unset($params["AuthToken"]);
$sublet_img = isset($params["sublet_img"]) ? $params["sublet_img"] : '';
unset($params["sublet_img"]);
$result = $this->subletMode->addSublet($params);
if ($result["code"] == 200) {
if(isset($params["sublet_img"])){
$this->addSubletImg($params["sublet_img"],$result["id"]);
if($sublet_img){
$this->addSubletImg($sublet_img,$result["msg"]);
}
return $this->response("200", "数据保存成功", $result["msg"]);
}
......@@ -136,7 +139,7 @@ class Sublet extends Basic
if(!$img_info)
return false;
$sublet_img = explode(',',$img_info);
$sublet_img = json_decode($img_info, true);
if(!$sublet_img)
return false;
......
......@@ -19,7 +19,7 @@ class SubletModel extends BaseModel
{
Db::startTrans();
try {
$id = $this->save($param);
$id = $this->insertGetId($param);
Db::commit();
return [ "code" => "200", "msg" => $id ];
} catch (\Exception $e) {
......@@ -27,7 +27,6 @@ class SubletModel extends BaseModel
return [ "code" => "101", "msg" => "失败,数据异常" ];
}
}
/**
......
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