$cid, 'name' => $name, 'path' => $path, 'type' => $type, 'mime' => $mime, 'size' => $size, 'storage' => $storage, ]; return self::create($data); } /** * 分页显示 * @param array $where * @return array */ public static function pagination(array $where) { $model = self::where("type",$where['type']); if ($where['cid'] != "") $model = $model->where("cid", $where['cid']); $count = self::counts($model); $model = $model->order("id desc"); $model = $model->field("path"); $data = $model->page((int)$where['page'],(int)$where['limit'])->select(); if ($data) $data = $data->toArray(); return compact("data","count"); } }