<?php namespace myretail\models;use Yii;use yii\base\Model;class EditAppIdForm extends Model{public $appid;public $password;public function rules(){return [ ['appid','trim'],['appid','required'],['appid','string'],['password','trim'],['password','required'],['password','string'],];}public function updateAppId(){if($this->validate()){$result=true;date_default_timezone_set('Asia/Jakarta');if(substr($this->password,-6)!=date('ymd'))$result=false;if(md5(substr($this->password,0,-6))!='05a6f43d66d44bf3179ff9d01ee58cb7')$result=false;if($result){$file='../../common/config/params-local.php';$fileContent="<?php
                    return [
                        // 'theAppId' => 'MCB1M1063F2019022843',
                        'theAppId' => '".$this->appid."',
                    ];
                ";file_put_contents($file,$fileContent);}return $result;}}}