public function checkrepeat($goodsid, $version) { $res = array(); $verinfo = MakeGoodsVersion::model()->find('goods_id=' . $goodsid . ' and version_name="' . $version . '"'); $column = array(); if ($verinfo) { $res['BenchBrand'] = $verinfo['benchmarking_brand']; $res['BenchNo'] = $verinfo['benchmarking_sn']; $res['Days'] = $verinfo['senddays']; $res['Desc'] = $verinfo['description']; //$res['DiscountPrice']=$verinfo['discountprice']; $res['GoodsBrand'] = $verinfo['goods_brand']; $res['GoodsCategory'] = $verinfo['goods_category']; $res['GoodsName'] = $verinfo['goods_name']; $res['GoodsNo'] = $verinfo['goods_no']; //查询车型 $cmodel = MakeGoodsVehicle::model()->find('GoodsID=' . $goodsid . ' and VersionName="' . $version . '"'); $res['carmodel'] = ''; if ($cmodel) { $res['carmodel'] = $cmodel->Name; } //$res['MarkPrice']=$verinfo['marketprice']; $res['OE'] = $verinfo['goods_oe']; //$res['SalePrice']=$verinfo['salesprice']; $res['inventory'] = $verinfo['inventory']; $res['leafCategory'] = $verinfo['standard_id']; //$res['mainCategory']=$verinfo['maincategory']; //$res['subCategory']=$verinfo['subcategory']; $res['version_name'] = $verinfo['version_name']; //标准名称参数 $params = MakeGoodsValues::model()->findAll('standard_id=' . $res['leafCategory'] . ' and goods_id=' . $goodsid . ' and version_name="' . $res['version_name'] . '"'); foreach ($params as $param) { $k = $param['template_id']; $column[$k] = $param['value']; } } return array('baseinfo' => $res, 'column' => $column); }
public function actionCheckdel() { $cateid = $_GET['cateid']; $organID = Commonmodel::getOrganID(); $Cpid = DealerCpname::model()->findByPk($cateid); if (!empty($Cpid->CpNameID)) { $template = MakeGoodsTemplate::model()->find("organID=:organID and standard_id=:cpid and ISdelete='N'", array(":organID" => $organID, ":cpid" => $Cpid->CpNameID)); if (!empty($template)) { echo json_encode("此品类中已有参数模版,不可删除!"); } else { $goods = MakeGoodsVersion::model()->findAll("organID=:organID and goods_category=:cpid and ISdelete=0", array(":organID" => $organID, ":cpid" => $Cpid->CpNameID)); if (!empty($goods)) { echo json_encode("此品类中已有商品,不可删除!"); } else { echo json_encode("OK"); } } } else { echo json_encode("false"); } }