public function view_getProductsPECountList() { $PEId = $_GET['PEId'] ? $_GET['PEId'] : ''; $tName = 'pc_products_pe_count'; $select = '*'; $where = "WHERE is_delete=0 "; if (intval($PEId) > 0) { $where .= "AND PEId='{$PEId}'"; } $PECountList = OmAvailableModel::getTNameList($tName, $select, $where); for ($i = 0; $i < count($PECountList); $i++) { $PECountList[$i]['hadAppointCount'] = getAppointSpuCountByWebMakerId($PECountList[$i]['PEId']); } $this->smarty->assign('navlist', $navlist); $this->smarty->assign('onevar', 5); $this->smarty->assign('twovar', 516); $this->smarty->assign('title', '指派数量维护'); $this->smarty->assign('PECountList', empty($PECountList) ? array() : $PECountList); $this->smarty->display("productsPECountList.htm"); }
function act_checkSubmitWebMaker() { $spu = $_POST['spu']; $isSingSpu = $_POST['isSingSpu']; $webMakerId = $_POST['webMakerId']; if ($isSingSpu == 2) { //虚拟料号 self::$errCode = '200'; self::$errMsg = "成功"; return true; } if (intval($webMakerId) <= 0 || isAccessAll('autoCreateSpu', 'isCanUpdateWebMakerPower')) { self::$errCode = '200'; self::$errMsg = "成功"; return true; } $tName = 'pc_spu_web_maker'; $select = 'webMakerId'; $where = "WHERE is_delete=0 and spu='{$spu}' order by id desc"; $spuWebMakerList = OmAvailableModel::getTNameList($tName, $select, $where); if ($spuWebMakerList[0]['webMakerId'] == $webMakerId) { self::$errCode = '200'; self::$errMsg = "成功"; return true; } /* 限制暂时不用 $platformIdArr = array(1,2,11);//其中一个平台必须要有对应销售人员记录 $platformIdStr = implode(',', $platformIdArr); $tName = 'pc_spu_saler_single'; $where = "WHERE is_delete=0 AND spu='$spu' AND platformId in($platformIdStr)"; $singleSalerInfoCount = OmAvailableModel::getTNameCount($tName, $where); if(!$singleSalerInfoCount){ self :: $errCode = '400'; self :: $errMsg = "ebay/aliexpress/amazon 平台中至少要存在一个销售人员记录"; return false; } **/ $tName = 'pc_spu_web_maker'; $select = 'isTake,isAgree'; $where = "WHERE is_delete=0 and spu='{$spu}' and webMakerId='{$webMakerId}' order by id desc"; $webMakerList = OmAvailableModel::getTNameList($tName, $select, $where); if ($webMakerList[0]['isTake'] != 0) { self::$errCode = '200'; self::$errMsg = "成功"; return true; } $appointedCountToWebMaker = getAppointSpuCountByWebMakerId($webMakerId); //已经指派给产品制作人的数量 $countPE = getPECountByPEId($webMakerId); //该产品制作人最多能被指派的数量 if ($appointedCountToWebMaker < $countPE) { self::$errCode = '200'; self::$errMsg = "成功"; return true; } else { self::$errCode = '404'; self::$errMsg = "该产品制作人数量已达极限,请重新选择产品制作人"; return false; } }