where(['shop_id' => $shop_id,'deleted' => 0])->find(); if (empty($shop)) { $this->error('非法操作'); } $city_list = Db::name('region')->where(['parent_id'=>$shop['province_id'],'level'=> 2])->select(); $district_list = Db::name('region')->where(['parent_id'=>$shop['city_id']])->select(); $shop_image_list = Db::name('shop_images')->where(['shop_id'=>$shop['shop_id']])->select(); $this->assign('city_list', $city_list); $this->assign('district_list', $district_list); $this->assign('shop_image_list', $shop_image_list); $this->assign('shop', $shop); } $province_list = Db::name('region')->where(['parent_id'=>0,'level'=> 1])->cache(true)->select(); $suppliers_list = Db::name("suppliers")->where(['is_check'=>1])->select(); $this->assign('suppliers_list', $suppliers_list); $this->assign('province_list', $province_list); return $this->fetch(); } public function add(){ header("Content-type: text/html; charset=utf-8"); exit("请联系TPshop官网客服购买高级版支持此功能"); } public function save(){ header("Content-type: text/html; charset=utf-8"); exit("请联系TPshop官网客服购买高级版支持此功能"); } /** * 删除 */ public function delete() { $shop_id = input('shop_id/d'); if(empty($shop_id)){ $this->ajaxReturn(['status' => 0, 'msg' => '参数错误']); } $Shop = new \app\common\model\Shop(); $shop = $Shop->where(['shop_id'=>$shop_id])->find(); if(empty($shop)){ $this->ajaxReturn(['status' => 0, 'msg' => '非法操作', 'result' => '']); } $row = $shop->save(['deleted'=>1]); if($row !== false){ $this->ajaxReturn(['status' => 1, 'msg' => '删除成功', 'result' => '']); }else{ $this->ajaxReturn(['status' => 0, 'msg' => '删除失败', 'result' => '']); } } public function shopImageDel() { $path = input('filename',''); Db::name('goods_images')->where("image_url",$path)->delete(); } }