苗火 Nicholas
[php]Onethink used 8421 code in checkbox
2019-3-16 萧


Onethink used 8421 code in checkbox, and if it is extra values must add processing function in logic model.



Like that:



Application\Admin\Logic\ProductLogic.class.php



 


 protected $_auto = array(
array('duoxuan', 'getDuoxuan', self::MODEL_BOTH, 'callback'),
);


 



 



    protected function getDuoxuan(){
$duoxuan = I('post.duoxuan');
if(!is_array($duoxuan)){
return 0;
}else{
$pos = 0;
foreach ($duoxuan as $key=>$value){
$pos += $value; //将各个推荐位的值相加
}
return $pos;
}
}

 



 

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容