78 lines
1.6 KiB
PHP
78 lines
1.6 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @author Any
|
|
* @description KISS
|
|
* @date 2020-11-5
|
|
* @version 1.0.0
|
|
*
|
|
* _____LOG_____
|
|
*
|
|
*/
|
|
|
|
namespace app\modules\store\models\report;
|
|
|
|
use app\components\EncryptHelper;
|
|
use app\components\FlashStorage;
|
|
use app\models\Admin;
|
|
use app\models\auth\RoleUser;
|
|
use app\models\CardUnion;
|
|
use app\models\District;
|
|
use app\models\Model;
|
|
use app\models\StoreUser;
|
|
use app\models\SysAdmin;
|
|
use app\models\User;
|
|
use app\modules\store\models\AdminModel;
|
|
use app\models\common\CommonUserEditForm;
|
|
use app\modules\api\models\StoreCityForm;
|
|
use Wechat\Wechat;
|
|
|
|
class ReportEditForm extends AdminModel
|
|
{
|
|
|
|
public $store_id;
|
|
|
|
public $model;
|
|
public $final_path;
|
|
public $user_type;
|
|
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['final_path'], 'string'],
|
|
[['final_path'], 'required'],
|
|
];
|
|
}
|
|
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'final_path' => '上传模型',
|
|
];
|
|
}
|
|
|
|
|
|
public function edit()
|
|
{
|
|
if (!$this->validate()) {
|
|
return $this->getModelError();
|
|
}
|
|
|
|
if ($this->user_type == 1) {
|
|
$this->model->initial_path = $this->final_path;
|
|
$this->model->step = 1;
|
|
$this->model->initial_at = time();
|
|
} else {
|
|
$this->model->final_path = $this->final_path;
|
|
$this->model->step = 2;
|
|
$this->model->final_at = time();
|
|
}
|
|
|
|
if (!$this->model->save()) {
|
|
return $this->getModelError($this->model);
|
|
}
|
|
return $this->apiReturnSuccess('上传成功');
|
|
}
|
|
|
|
|
|
} |