255], [['mobile'], 'string', 'max' => 30], [['memo'], 'string', 'max' => 1000], ]; } public function savePartnerApply() { if ($this->validate()) { $api = new IndexApi(); $data = []; $data['type'] = $this->type; $data['name'] = $this->name; $data['mobile'] = $this->mobile; $data['email'] = $this->email; $data['memo'] = $this->memo; $result = $api->savePartnerApply($data); if ($result['code'] == 1) { return true; } else { if (is_array($result['message'])) { $this->addErrors($result['message']); } else { $this->addError('name', $result['message']); } } } return !$this->hasErrors(); } }