初始化仓库

This commit is contained in:
2024-09-19 11:32:39 +08:00
commit 8f5315e936
921 changed files with 76455 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace service\models\forms;
use common\core\BaseModel;
use common\models\BaseConfig;
use yii\db\Exception;
// 协议
class AgreementForm extends BaseModel
{
public $end;
public function rules()
{
return [
['end', 'required'],
];
}
public function attributeLabels()
{
return [
'end' => '区分端',
];
}
public function getAgreement()
{
if (!$this->validate()){
throw new Exception($this->getErrorMsg());
}
return BaseConfig::find()
->where([
'end' => $this->end,
'status' => 0,
'store_id'=>\Yii::$app->store
])->andWhere(['type'=>[1,2]])
->select(['content', 'change_at'])
->orderBy(['change_at' => SORT_DESC])
->all();
}
}