mirror of https://gitee.com/karson/fastadmin.git
39 lines
904 B
PHP
39 lines
904 B
PHP
<?php
|
||
/**
|
||
* @desc: 上传附件时,自动保存站点ID
|
||
* @Author: Dr.Xing <ezfwork@foxmail.com>
|
||
* @Since: 2018/2/9 19:58
|
||
*/
|
||
|
||
namespace seven\behavior;
|
||
|
||
|
||
class TakeAttach
|
||
{
|
||
public function run(&$params)
|
||
{
|
||
//upload
|
||
if ($params instanceof \think\Model) {
|
||
if(\think\Session::has('user_site_id')) {
|
||
$params->site_id = \think\Session::get('user_site_id');
|
||
$params->canDelete = 1;
|
||
$params->save();
|
||
return;
|
||
}
|
||
if(request()->param('siteid')) {
|
||
$params->site_id = request()->param('siteid');
|
||
$params->canDelete = 1;
|
||
$params->save();
|
||
}
|
||
}
|
||
//del
|
||
elseif ($params instanceof \think\Controller) {
|
||
//$attId = request()->param('ids');
|
||
}
|
||
//unknow
|
||
else {
|
||
|
||
}
|
||
}
|
||
|
||
} |