You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
862 B
46 lines
862 B
<?php
|
|
declare (strict_types=1);
|
|
|
|
namespace app\api\model;
|
|
|
|
use think\Model;
|
|
|
|
|
|
/**
|
|
* @mixin think\Model
|
|
*/
|
|
class ImageStorages extends Common
|
|
{
|
|
|
|
public $table = 'system_image_storages';
|
|
|
|
|
|
public function index(){
|
|
$type = $this->request->param('type', 0);
|
|
$_op = $this->field('*');
|
|
|
|
if($type){
|
|
$_op = $this->where('type',$type);
|
|
}
|
|
|
|
//执行通用查询
|
|
return parent::parentLists($_op);
|
|
}
|
|
|
|
/**
|
|
* 读取后
|
|
* @param Model $model
|
|
* @return bool|void
|
|
*/
|
|
public static function onAfterRead(Model $model)
|
|
{
|
|
if (in_array(request()->action(), ['edit', 'delete', 'status'])) {
|
|
return true;
|
|
}
|
|
$typeArr = config('dict.sqlfields.image_storage_type');
|
|
|
|
$model->setAttr('type_str',$typeArr[$model->getAttr('type')]);
|
|
|
|
}
|
|
|
|
}
|
|
|