/** * 删除品牌 */ public function actionDeletebrand() { $brandID = $_POST['id']; $bool = DealerBrand::model()->deleteByPk($brandID); if ($bool) { $rs = array('success' => 1, 'errorMsg' => '删除数据成功'); } else { $rs = array('success' => 0, 'errorMsg' => '删除数据失败'); } echo json_encode($rs); }
public function actionDetail() { $model = Dealer::model()->find("userID=:userID", array(":userID" => $_GET['dealer'])); // 机构照片 $organphotoSql = "select id, photoName from tbl_dealer_organphoto where dealerID = " . $_GET['dealer']; $organphotos = DBUtil::queryAll($organphotoSql); $brands = DealerBrand::model()->findAll("OrganID = {$_GET['dealer']}"); $data = array(); foreach ($brands as $key => $brand) { $data[$key]['brandname'] = $brand['BrandName']; } //主营车系 $dealerv = DealerVehicle::model()->findAll("userID=:userID", array(":userID" => $_GET['dealer'])); //主营品类 $cpnames = DealerCpname::model()->findAll("OrganID=:userID", array(":userID" => $_GET['dealer'])); $this->render("detail", array('model' => $model, 'organphotos' => $organphotos, 'dealerv' => $dealerv, 'cpnames' => $cpnames, 'data' => $data)); }
<hr> <div class="form-row"> <!--<p class="form-row">--> <!-- <input id="goodsBrand" type="text" name="goodsBrand" class="width213 input">--> <!-- </p>--> <!-- <label>配件类别号:</label> <input type="text" name="PartsNO" class="width100 input">--> <!-- <label>嘉配号:</label> <input type="text" name="JiapartsNO" class="width100 input">--> <label>商品品牌:</label> <?php $organID = Commonmodel::getOrganID(); $brandNames = DealerBrand::model()->findAll("OrganID = {$organID}"); $brandName = CHtml::listData($brandNames, 'ID', 'BrandName'); echo CHtml::dropDownList('goodsBrand', 'goodsBrand', $brandName, array('class' => 'width110 select', 'empty' => '选择商品品牌')); ?> <input type="hidden" name="brandID"> <label>上架:</label> <select class="select" name="IsUpSale"> <option value="1">上架</option> <option value="0">下架</option> </select> <label>OE 号:</label> <input type="text" name="OENO" id="OENOValue" class="width100 input"> <span id='addOENO' class="btn" style="cursor:pointer">添加</span> </div> <p class="form-row" id="showOENO" ><!-- 显示OENO -->
</span></div></td> <td><?php echo CHtml::link($dealer['organName'], array('/servicer/servicequery/detail/dealer/' . $dealer['userID']), array('target' => '_blank')); ?> </td> <td><?php Area::showCity($dealer['province']) . Area::showCity($dealer['city']) . Area::showCity($dealer['area']); echo $dealer['address']; ?> </td> <td><?php echo $dealer['Phone']; ?> </td> <td><?php $data = DealerBrand::model()->findAll("OrganID =" . $dealer['userID']); ?> <?php foreach ($data as $k => $datas) { ?> <?php $brands .= $datas['BrandName']; ?> <?php if (isset($data[$k + 1])) { $brands .= '、'; } ?> <?php } ?>
public function actionDelbrandshoto() { $id = Yii::app()->request->getParam("key"); $type = Yii::app()->request->getParam("app"); if (Yii::app()->request->isPostRequest) { if ($type == "one") { $result = DealerBrand::model()->updateByPk($id, array("url1" => "")); } else { $result = DealerBrand::model()->updateByPk($id, array("url2" => "")); } } if ($result) { $model = DealerBrand::model()->findByPk($id); Yii::app()->redis->set('Brand' . $model->BrandID . 'o' . $model->OrganID, 'false'); echo json_encode(array("result" => 1, "msg" => "删除成功!")); } else { echo json_encode(array("result" => 0, "msg" => "数据删除失败!")); } }