Commit d72dcca3 authored by zhuwei's avatar zhuwei

删除商铺对应的收藏商铺也要删除(改状态值)

parent 9b9bbfa2
......@@ -12,6 +12,7 @@ namespace app\index\controller;
use app\api_broker\service\LookShopService;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\ACollectHouse;
use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
......@@ -298,6 +299,11 @@ class Houses extends Basic
if ($this->params['id']) {
$this->house->isUpdate(true)->save([ 'status' => 3 ], [ 'id' => $this->params['id'] ]);
//删除商铺对应的收藏商铺也要删除(改状态值)delCollectHouse
$collect_house =new ACollectHouse();
$collect_house->delCollectHouse($this->params['id']);
$data['msg'] = 'successfully deleted';
} else {
$data['status'] = 101;
......
......@@ -67,4 +67,18 @@ class ACollectHouse extends Model
return $result;
}
/**
* 更新数据
* 朱伟 2018-08-08
*/
public function delCollectHouse($id)
{
$result = Db::table($this->table)
->where('house_id', $id)
->update([ 'status' => 3 ]);
//dump($this->getLastSql());
return $result;
}
}
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