'一级佣金', // 'distributionTwoBrokerage' => '二级佣金', 'distributionOneGuildDaren' => '一级分销公会佣金比例(为公会成员情况)', 'distributionOnePushUser' => '一级分销推广员佣金比例(非公会成员情况)', 'distributionOneGuildUser' => '一级分销公会佣金比例(非公会成员情况)', 'distributionPoster' => '海报', 'distributionRuleIntro' => '邀请规则介绍', ]; } public function save() { if($this->validate()){ $attrs = $this->attributes; foreach ($attrs as $key => $value){ if(empty($value)) continue; $key = Utils::hump2underline($key); $key = strtoupper($key); if($key == 'DISTRIBUTION_POSTER'){ if(!is_array($value)){ $distributionPoster = json_decode($value,true); if(count($distributionPoster) > 10){ return [ 'code' => 1, 'msg' => '海报图最多上传10张' ]; } } } $f = Option::setOption($key, $value, $this->cx_mch_id); if(!$f){ return [ 'code' => 1, 'msg' => $key . '保存失败' ]; } } return [ 'code' => 0, 'msg' => '保存成功' ]; } else { return $this->getModelError(); } } }