Commit 9b96f060 authored by clone's avatar clone Committed by hujun

bug

parent 4e83a3b1
...@@ -193,7 +193,7 @@ class Shop extends Basic ...@@ -193,7 +193,7 @@ class Shop extends Basic
$attention["is_del"] = array( "eq", 0 );; $attention["is_del"] = array( "eq", 0 );;
$attResult = $this->attentionModel->getAttentionByUserIdAndHouseId($attention); $attResult = $this->attentionModel->getAttentionByUserIdAndHouseId($attention);
if (count($attResult) > 0) if (count($attResult) > 0)
$result ["attention"] = $attResult["id"]; $result ["attention"] = $attResult[0]["id"];
} }
......
...@@ -111,13 +111,10 @@ class AttentionModel extends Model ...@@ -111,13 +111,10 @@ class AttentionModel extends Model
*/ */
public function getAttentionByUserIdAndHouseId($params) public function getAttentionByUserIdAndHouseId($params)
{ {
$result = $this->field("id") return $this->field("id")
->where($params) ->where($params)
->limit(1) ->limit(1)
->select(); ->select();
if (count($result) > 0) {
return $result[0];
}
return null;
} }
} }
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