Commit 831471fd by 杨昕

Merge branch 'test' into 'master'

Test

See merge request !36
parents fc81ccec fdc5adc3
Pipeline #14125 passed with stages
in 8 minutes 19 seconds
<?php
namespace App\Exports;
use App\Model\MediaModel;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithColumnWidths;
class MediasExport implements WithHeadings,FromArray,WithColumnWidths
{
use Exportable;
public function __construct($params)
{
$this->media_ids = $params;
}
public function columnWidths(): array
{
return [
'A' => 30,
'B' => 55,
'C' => 45,
'D' => 45,
'E' => 55
];
}
/**
* 设置表头
* @return array
*/
public function headings(): array
{
return [
'媒资编号',
"名称",
'视频名称',
"永久播放地址",
"全屏预览地址",
];
}
public function array(): array
{
return $this->media_ids;
}
}
<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithColumnWidths;
use Maatwebsite\Excel\Concerns\WithStyles;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
class MubanExport implements WithColumnWidths,WithHeadings,FromArray,WithStyles
{
use Exportable;
public function headings(): array
{
return [
'名称',
'媒资编号',
];
}
/**
* 设置表头
* @return array
*/
public function columnWidths(): array
{
return [
'A' => 55,
'B' => 45,
];
}
public function array(): array
{
return [
["【第一章马克思主义哲学是科学的世界观和方法论第一节哲学及其基本问题】.mp4", "mda-250f994a93f2688ba225532c641b2a34"],
["【19课堂】2021.03.02-月半时政-脱贫攻坚-公基-李浩祥】.mp4", "mda-a4c0ad458d3592ff798277a42cb57be6"],
["视频名称是必填项","媒资编号为必填项"]
];
}
public function styles(Worksheet $sheet)
{
return [
'A4' => ['font' => ['bold' => true]],
'B4' => ['font' => ['bold' => true]],
];
}
}
...@@ -376,14 +376,19 @@ function getRbac($request,$url='api/ram',$appid = '' ,$type='base'){ ...@@ -376,14 +376,19 @@ function getRbac($request,$url='api/ram',$appid = '' ,$type='base'){
$staffNo = $request->username; $staffNo = $request->username;
$rbac_url = $rbac.'/rbac/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&staffNo='.$staffNo; $rbac_url = $rbac.'/rbac/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&staffNo='.$staffNo;
break; break;
#清除CND缓存
case 'clear_cache': case 'clear_cache':
$rbac_url = $rbac.'/cdn/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak; $rbac_url = $rbac.'/cdn/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak;
break; break;
#获取单个视频永久播放链接地址
case 'play_m3u8': case 'play_m3u8':
$rbac_url = $rbac.'/chain/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&mediaId='.$appid.'&pathForever=1'; $rbac_url = $rbac.'/chain/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&mediaId='.$appid.'&pathForever=1';
break; break;
#批量获取获取多个永久播放链接地址
case 'mul_play_m3u8':
$rbac_url = $rbac.'/chain/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&pathForever=1';
break;
default: default:
$rbac_url = $rbac.'/rbac/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&appid='.$appid.'&uid='.$mis_uid; $rbac_url = $rbac.'/rbac/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&appid='.$appid.'&uid='.$mis_uid;
......
...@@ -46,7 +46,7 @@ class MediaCategoryController extends Controller ...@@ -46,7 +46,7 @@ class MediaCategoryController extends Controller
SrsHookValidate::srsHookCallback($request,[ SrsHookValidate::srsHookCallback($request,[
'name' => 'required', 'name' => 'required',
'media_category_id' => '', 'media_category_id' => 'required',
'status' => '', 'status' => '',
'description' => '' 'description' => ''
]); ]);
...@@ -85,11 +85,12 @@ class MediaCategoryController extends Controller ...@@ -85,11 +85,12 @@ class MediaCategoryController extends Controller
SrsHookValidate::srsHookCallback($request,[ SrsHookValidate::srsHookCallback($request,[
'name' => 'required', 'name' => 'required',
'media_category_id' => '', 'media_category_id' => 'required',
'status' => '', 'status' => '',
'description' => '', 'description' => '',
]); ]);
MediaCategoryModel::updateMediaCatg($request,$id); MediaCategoryModel::updateMediaCatg($request,$id);
}); });
...@@ -97,4 +98,26 @@ class MediaCategoryController extends Controller ...@@ -97,4 +98,26 @@ class MediaCategoryController extends Controller
} }
/**
* @param Request $request
* @return \Illuminate\Http\JsonResponse
* @throws \App\Exceptions\ControllerException
*/
public function disable(Request $request)
{
handler_drive(function () use($request){
$id = $request->id;
SrsHookValidate::srsHookCallback($request,[
'status' => '',
]);
MediaCategoryModel::disable($request,$id);
});
return success();
}
} }
...@@ -2,12 +2,20 @@ ...@@ -2,12 +2,20 @@
namespace App\Http\Controllers\Web; namespace App\Http\Controllers\Web;
use App\Exports\MediasExport;
use App\Exports\MubanExport;
use App\Imports\MediasImport;
use App\Model\DownloadRecord;
use App\Model\MediaCategoryModel; use App\Model\MediaCategoryModel;
use App\Model\MediaModel; use App\Model\MediaModel;
use App\Tool\SrsHookValidate; use App\Tool\SrsHookValidate;
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\App;
use Maatwebsite\Excel\Facades\Excel;
use Qiniu\Auth;
class MediaController extends Controller class MediaController extends Controller
{ {
...@@ -27,19 +35,19 @@ class MediaController extends Controller ...@@ -27,19 +35,19 @@ class MediaController extends Controller
// php 特殊字符转义,实现字符串安全存入数据库, // php 特殊字符转义,实现字符串安全存入数据库,
SrsHookValidate::srsHookCallback($request,[ // SrsHookValidate::srsHookCallback($request,[
'media_name' => '', // 'media_name' => '',
'username' => '', // 'username' => '',
'page' => 'integer', // 'page' => 'integer',
'media_id' => '', // 'media_id' => '',
'description' => '', // 'description' => '',
'sort' => '', // 'sort' => '',
'page_size' => 'integer', // 'page_size' => 'integer',
'start_time' => 'date', // 'start_time' => 'date',
'end_time' => 'date', // 'end_time' => 'date',
'category_id' => '', // 'category_id' => '',
'appid' => '' // 'appid' => ''
]); // ]);
$medias = MediaModel::mediaList($request); $medias = MediaModel::mediaList($request);
...@@ -221,4 +229,134 @@ class MediaController extends Controller ...@@ -221,4 +229,134 @@ class MediaController extends Controller
return success($res); return success($res);
} }
/**
* @param Request $request
* @param $type
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
*/
public function export_batch_media(Request $request){
$type = $request->type??'media';
$data = null;
switch ($type){
case 'media':
$data = new MediasExport(["mda-f72b5ea1c0dfc7203bf7ac522cd8baf9","mda-f6eb263d99752afc"]);
break;
case 'muban':
$data = new MubanExport();
break;
default:
$data = new MediasExport(["mda-f72b5ea1c0dfc7203bf7ac522cd8baf9","mda-f6eb263d99752afc"]);
break;
}
return Excel::download($data,$type.'.xlsx');
}
/**
* 展示批处理文件
* @param Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function batch_media(Request $request){
return view('admin.media.batch_media',$request->all());
}
/**
* 批量导出永久地址
* @param Request $request
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
* @throws \App\Exceptions\ControllerException
*/
public function import_batch_media(Request $request){
// $type = $request->type??'media';
$data = handler_drive(function () use($request){
$file = $request->file('uploadFile');
#将文件内容转化为数组
$sheet = (new MediasImport())->toArray($file);
$orginal_data = null;
foreach ($sheet as $k => $v){
if (!empty($v)){
$orginal_data = $v;
break;
}
}
if (empty($orginal_data)){
throw new \Exception("文件格式有误");
}
$temp = [];
foreach ($orginal_data as $key => $item){
if (!isset($item["媒资编号"]) || !isset($item["名称"])){
throw new \Exception("文件格式有误");
}
$temp[$item['媒资编号']] = [
'media_id' => $item["媒资编号"],
'name' => $item['名称']
];
}
$data = [];
if (!empty($orginal_data)){
#批量获取永久播放链接地址
$mediaInfos = MediaModel::batchGetMediaForverM3u8($request,$temp);
$data = new MediasExport(array_values($mediaInfos));
}
$record = md5(json_encode($data));
DownloadRecord::addRecord($record,$data);
return $record;
});
return success($data);
}
/**
* @param Request $request
* @param $keyId
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
* @throws \App\Exceptions\ControllerException
*/
public function download(Request $request,$keyId){
$data = handler_drive(function () use($keyId){
$record = DownloadRecord::getRecord($keyId);
if (empty($record)){
throw new \Exception("数据不存在");
}
$content = json_decode($record['content'],true);
DownloadRecord::delRecord($keyId);
return new MediasExport($content);
});
return Excel::download($data,'media.xlsx');
}
} }
...@@ -25,7 +25,6 @@ class MemberController extends Controller ...@@ -25,7 +25,6 @@ class MemberController extends Controller
* users跟新验证 * users跟新验证
*/ */
protected $users_update_verify = [ protected $users_update_verify = [
'_id' => 'required',
'name' => 'required', 'name' => 'required',
'status' => '' 'status' => ''
]; ];
...@@ -125,6 +124,7 @@ class MemberController extends Controller ...@@ -125,6 +124,7 @@ class MemberController extends Controller
{ {
handler_drive(function () use ($request,$id) { handler_drive(function () use ($request,$id) {
SrsHookValidate::srsHookCallback($request, $this->users_update_verify); SrsHookValidate::srsHookCallback($request, $this->users_update_verify);
if (!$this->checkOwnHandle($id)) { if (!$this->checkOwnHandle($id)) {
...@@ -135,7 +135,7 @@ class MemberController extends Controller ...@@ -135,7 +135,7 @@ class MemberController extends Controller
throw new \App\Exceptions\FormException('你不能操作你自己'); throw new \App\Exceptions\FormException('你不能操作你自己');
} }
UserModel::createOrUpdateUser($request); UserModel::createOrUpdateUser($request,$id);
}); });
...@@ -242,10 +242,12 @@ class MemberController extends Controller ...@@ -242,10 +242,12 @@ class MemberController extends Controller
$user = Auth::user(); $user = Auth::user();
if ($user->name != config('custom.supper_admin.name')) { if ($user->name != config('custom.supper_admin.name')) {
$result = UserModel::find($user_id); $result = UserModel::find($user_id);
if ($result === null) { if ($result === null) {
return false; return false;
} }
...@@ -255,6 +257,7 @@ class MemberController extends Controller ...@@ -255,6 +257,7 @@ class MemberController extends Controller
return false; return false;
} }
} }
return true; return true;
} }
......
...@@ -18,10 +18,19 @@ class PrivilegeController extends Controller ...@@ -18,10 +18,19 @@ class PrivilegeController extends Controller
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$user = Auth::user();
if ($user->name == config("custom.supper_admin")['name']){
$url = getRbac($request);
$data['url'] = $url;
return view('admin.privilege.list',$data);
}
$url = getRbac($request,'api/open/check'); $url = getRbac($request,'api/open/check');
$data['appid'] = $request->appid; $data['appid'] = $request->appid;
$data['uid'] = Auth::user()->mis_uid; $data['uid'] = $user->mis_uid;
$data['tree'] = 1; $data['tree'] = 1;
...@@ -31,6 +40,7 @@ class PrivilegeController extends Controller ...@@ -31,6 +40,7 @@ class PrivilegeController extends Controller
$data $data
); );
$result = json_decode($result,true); $result = json_decode($result,true);
if (empty($result['data'])){ if (empty($result['data'])){
......
...@@ -10,6 +10,9 @@ class TestController extends Controller ...@@ -10,6 +10,9 @@ class TestController extends Controller
// //
function index(Request $request){ function index(Request $request){
phpinfo();
// $staffNo = $request->username??"yf60144"; // $staffNo = $request->username??"yf60144";
// $url = 'http://api-mis.offcn.com/index.php/applogin/isworking'; // $url = 'http://api-mis.offcn.com/index.php/applogin/isworking';
// $data = sign($staffNo); // $data = sign($staffNo);
...@@ -25,24 +28,24 @@ class TestController extends Controller ...@@ -25,24 +28,24 @@ class TestController extends Controller
// $userInfo = json_decode($result,true); // $userInfo = json_decode($result,true);
$staffNo = $request->username??"yf60144";; // $staffNo = $request->username??"yf60144";;
$url = 'http://api-mis.offcn.com/index.php/applogin/isworking'; // $url = 'http://api-mis.offcn.com/index.php/applogin/isworking';
$data = sign($staffNo); // $data = sign($staffNo);
$data['type'] = 6; // $data['type'] = 6;
$data['username'] = $staffNo; // $data['username'] = $staffNo;
$ch = curl_init(); // $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true); // curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); // curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_HEADER, false); // curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10); // curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$result = curl_exec($ch); // $result = curl_exec($ch);
//
$userInfo = json_decode($result,true); // $userInfo = json_decode($result,true);
//
//
var_dump($userInfo); // var_dump($userInfo);
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace App\Http\Middleware; namespace App\Http\Middleware;
use App\Exceptions\ControllerException; use App\Exceptions\ControllerException;
use App\Model\MediaCategoryModel;
use Closure; use Closure;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
...@@ -34,6 +35,13 @@ class ApiMiddleware ...@@ -34,6 +35,13 @@ class ApiMiddleware
$user = Auth::user(); $user = Auth::user();
if ($request->category_id){
$mediaCatg = MediaCategoryModel::where("_id",$request->category_id)->first();
$request->replace(array_merge($request->all(),['catetory_name'=>$mediaCatg->name]));
}
if (isset($user->mis_uid)){ if (isset($user->mis_uid)){
$request->replace(array_merge($request->all(),['mis_uid'=>$user->mis_uid])); $request->replace(array_merge($request->all(),['mis_uid'=>$user->mis_uid]));
} }
......
...@@ -15,6 +15,7 @@ class MediaCategoryRoute extends AuthenRoute ...@@ -15,6 +15,7 @@ class MediaCategoryRoute extends AuthenRoute
public function map(Registrar $router,$callback){ public function map(Registrar $router,$callback){
parent::map($router,function() use ($router){ parent::map($router,function() use ($router){
$router->resource('media_category','MediaCategoryController'); $router->resource('media_category','MediaCategoryController');
$router->post('media_category/disable','MediaCategoryController@disable');
}); });
} }
......
...@@ -19,6 +19,19 @@ class MediaRoute extends AuthenRoute ...@@ -19,6 +19,19 @@ class MediaRoute extends AuthenRoute
$router->get('video_preview/{media_num}','MediaController@media_preview'); $router->get('video_preview/{media_num}','MediaController@media_preview');
$router->post('set_media_num','MediaController@setMediaNum'); $router->post('set_media_num','MediaController@setMediaNum');
$router->get('clear_cdn_cache/{media_id}','MediaController@clearCdnCache'); $router->get('clear_cdn_cache/{media_id}','MediaController@clearCdnCache');
#导入待处理media编号excel表格
$router->post('media_manager/import_batch_media','MediaController@import_batch_media');
#展示批处理页面
$router->get('media_manager/batch_media','MediaController@batch_media');
#导出展示批处理
$router->get('media_manager/export_batch_media','MediaController@export_batch_media');
$router->get("/media_manager/download/{keyId}",'MediaController@download');
}); });
} }
......
<?php
namespace App\Imports;
use Maatwebsite\Excel\Concerns\Importable;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Concerns\RegistersEventListeners;
class MediasImport implements WithHeadingRow,WithEvents{
use Importable,RegistersEventListeners;
}
\ No newline at end of file
<?php
namespace App\Model;
use App\Exceptions\DatabaseException;
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
use MongoDB\BSON\UTCDateTime;
class DownloadRecord extends Eloquent
{
protected $collection = "download_record";
protected $connection = 'mongodb'; //使用mongodb
protected $primaryKey = '_id';
/**
* @param $keyId
* @param $data
* @return mixed
* @throws DatabaseException
*/
public static function addRecord($keyId,$data){
try{
$record = self::getRecord($keyId);
if (empty($record)){
$create_time = new UTCDateTime(time() * 1000);;
$data = [
'key_id' => $keyId,
'content' => json_encode($data),
'create_time' => $create_time,
];
$id = DownloadRecord::insertGetId($data);
}else{
$id = $record['id'];
}
}catch (\Exception $exception){
throw new DatabaseException($exception->getMessage());
}
return $id;
}
/**
* @param $keyId
* @return mixed
* @throws DatabaseException
*/
public static function getRecord($keyId){
try{
$record = DownloadRecord::where("key_id",$keyId)->first();
}catch (\Exception $exception){
throw new DatabaseException($exception->getMessage());
}
return $record;
}
/**
* 删除记录
* @param $keyId
* @return mixed
* @throws DatabaseException
*/
public static function delRecord($keyId){
try{
$flag = DownloadRecord::where("key_id",$keyId)->delete();
}catch (\Exception $exception){
throw new DatabaseException($exception->getMessage());
}
return $flag;
}
}
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
namespace App\Model; namespace App\Model;
use App\Exceptions\DatabaseException; use App\Exceptions\DatabaseException;
use App\Tool\Constant;
use http\Env\Request; use http\Env\Request;
use Jenssegers\Mongodb\Eloquent\Model as Eloquent; use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
use MongoDB\BSON\UTCDateTime;
class MediaCategoryModel extends Eloquent class MediaCategoryModel extends Eloquent
{ {
...@@ -31,17 +33,22 @@ class MediaCategoryModel extends Eloquent ...@@ -31,17 +33,22 @@ class MediaCategoryModel extends Eloquent
/** /**
* 获取用户业务线及对应业务线的权限 * 获取用户业务线及对应业务线的权限
*/ */
$catgList = MediaCategoryModel::where('status',0)->limit(20)->get()->toArray();
$appids = array_column($catgList,"media_category_id");
#需要传一个默认的appid,否则接口会报参数缺失错误
$url = getRbac($request,'api/open/getPlatform','ec8747abc5dbe8288e64f327a76ac517'); $url = getRbac($request,'api/open/getPlatform','ec8747abc5dbe8288e64f327a76ac517');
$result = http_request_code($url, $result = http_request_code($url,
array( array(
"Content-Type: application/json" "Content-Type: application/json"
), ),
'POST', 'POST',
json_encode(array()) json_encode($appids)
); );
LogModel::addlog(['获取商店列表'=>json_decode($result)]);
$catgs = json_decode($result,true); $catgs = json_decode($result,true);
if (!isset($catgs['data'])){ if (!isset($catgs['data'])){
...@@ -49,13 +56,8 @@ class MediaCategoryModel extends Eloquent ...@@ -49,13 +56,8 @@ class MediaCategoryModel extends Eloquent
throw new \Exception("获取商店列表失败"); throw new \Exception("获取商店列表失败");
} }
$catgList = MediaCategoryModel::get()->toArray();
$appids = array_column($catgs['data'],"appid"); $appids = array_column($catgs['data'],"appid");
$tmp = []; $tmp = [];
foreach ($catgList as $catg){ foreach ($catgList as $catg){
...@@ -64,7 +66,6 @@ class MediaCategoryModel extends Eloquent ...@@ -64,7 +66,6 @@ class MediaCategoryModel extends Eloquent
} }
} }
}catch (\Exception $exception){ }catch (\Exception $exception){
throw new DatabaseException($exception->getMessage()); throw new DatabaseException($exception->getMessage());
} }
...@@ -86,7 +87,7 @@ class MediaCategoryModel extends Eloquent ...@@ -86,7 +87,7 @@ class MediaCategoryModel extends Eloquent
$where['name'] = $request->name; $where['name'] = $request->name;
} }
$catgList = MediaCategoryModel::where($where)->paginate(10); $catgList = MediaCategoryModel::where($where)->orderBy("create_time",Constant::SORT_DESC)->paginate(10);
}catch (\Exception $exception){ }catch (\Exception $exception){
throw new DatabaseException("类别不存在"); throw new DatabaseException("类别不存在");
...@@ -104,11 +105,14 @@ class MediaCategoryModel extends Eloquent ...@@ -104,11 +105,14 @@ class MediaCategoryModel extends Eloquent
public static function addMediaCatg($request){ public static function addMediaCatg($request){
try{ try{
$create_time = new UTCDateTime(time() * 1000);;
$data = [ $data = [
'name' => $request->name, 'name' => $request->name,
'status' => 0, 'status' => 0,
'media_category_id' => $request->media_category_id??'', 'media_category_id' => $request->media_category_id??'',
'description' => $request->description??'' 'description' => $request->description??'',
'create_time' => $create_time,
]; ];
$mediaCatg = MediaCategoryModel::where('name',$request->name)->first(); $mediaCatg = MediaCategoryModel::where('name',$request->name)->first();
...@@ -162,4 +166,38 @@ class MediaCategoryModel extends Eloquent ...@@ -162,4 +166,38 @@ class MediaCategoryModel extends Eloquent
} }
return $flag; return $flag;
} }
/**
* 禁用媒资店铺
* @param $request
* @param $id
* @return mixed
* @throws DatabaseException
*/
public static function disable($request,$id){
try{
$data = [
'status' => $request->status??0,
];
$mediaCatg = MediaCategoryModel::where('_id',$id)->first();
if (empty($mediaCatg)){
throw new \Exception('媒资类别不存在');
}
$flag = MediaCategoryModel::where("_id",$id)->update($data);
if (!$flag){
throw new \Exception("媒资类别更新失败");
}
}catch (\Exception $exception){
throw new DatabaseException($exception->getMessage());
}
return $flag;
}
} }
...@@ -24,6 +24,8 @@ class MediaModel extends Eloquent ...@@ -24,6 +24,8 @@ class MediaModel extends Eloquent
public $timestamps = false; public $timestamps = false;
public static $max_page_size = 500;
public function media_category() public function media_category()
...@@ -46,8 +48,8 @@ class MediaModel extends Eloquent ...@@ -46,8 +48,8 @@ class MediaModel extends Eloquent
$limit = (isset($request->page_size) ? (int)($request->page_size) : Constant::PAGE_NUMBER) ; $limit = (isset($request->page_size) ? (int)($request->page_size) : Constant::PAGE_NUMBER) ;
if ($limit >500){ if ($limit >self::$max_page_size){
$limit = 500; $limit = self::$max_page_size;
} }
$page = $request->page??1; $page = $request->page??1;
...@@ -60,42 +62,45 @@ class MediaModel extends Eloquent ...@@ -60,42 +62,45 @@ class MediaModel extends Eloquent
$sort = 1; $sort = 1;
} }
$match = [
'status' => ["\$in" => [null,"1"]],
"media_url" => ["\$ne" => 'null']
];
if (isset($request->media_id) && !empty($request->media_id)){ if (isset($request->media_id) && !empty($request->media_id)){
$aggregate[]['$match']['_id'] = $request->media_id; $match['_id'] = $request->media_id;
} }
if (isset($request->category_id) && !empty($request->category_id)){ if (isset($request->category_id) && !empty($request->category_id)){
$aggregate[]['$match']['media_type_id'] = $request->category_id; $match['media_type_id'] = $request->category_id;
} }
// status:代表未转码
$aggregate[]['$match']['status'] = ["\$ne" => '0'];
$aggregate[]['$match']['media_url'] = ["\$ne" => 'null'];
// $aggregate[]['$match']['_id'] = 'mda-864371b9a82d1e21'; // $aggregate[]['$match']['_id'] = 'mda-864371b9a82d1e21';
if (isset($request->media_name) && !empty($request->media_name)){ if (isset($request->media_name) && !empty($request->media_name)){
$aggregate[]['$match']['media_name'] = ['$regex' => addslashes($request->media_name) ]; $match['media_name'] = ['$regex' => addslashes($request->media_name) ];
} }
if (isset($request->username) && !empty($request->username)){ if (isset($request->username) && !empty($request->username)){
$aggregate[]['$match']['username'] = ['$regex' => addslashes($request->username) ]; $match['username'] = ['$regex' => addslashes($request->username) ];
} }
if (isset($request->description) && !empty($request->description)){ if (isset($request->description) && !empty($request->description)){
$aggregate[]['$match']['description'] = ['$regex' => $request->description ]; $match['description'] = ['$regex' => $request->description ];
} }
if (isset($request->start_time)&& !empty($request->start_time)){ if (isset($request->start_time)&& !empty($request->start_time)){
$start_time = new UTCDateTime(strtotime($request->start_time) * 1000); $start_time = new UTCDateTime(strtotime($request->start_time) * 1000);
$aggregate[]['$match']['start_time'] = ['$gt' => $start_time ]; $match['start_time'] = ['$gt' => $start_time ];
} }
if (isset($request->end_time)&& !empty($request->end_time)){ if (isset($request->end_time)&& !empty($request->end_time)){
$end_time = new UTCDateTime(strtotime($request->end_time) * 1000);; $end_time = new UTCDateTime(strtotime($request->end_time) * 1000);;
$aggregate[]['$match']['end_time'] = ['$lt' => $end_time ]; $match['$match']['end_time'] = ['$lt' => $end_time ];
} }
$aggregate[]['$match'] = $match;
$aggregate1 = $aggregate; $aggregate1 = $aggregate;
$aggregate[]['$sort'] = ['start_time' => $sort]; $aggregate[]['$sort'] = ['start_time' => $sort];
...@@ -105,6 +110,7 @@ class MediaModel extends Eloquent ...@@ -105,6 +110,7 @@ class MediaModel extends Eloquent
'count'=>array('$sum'=>1) 'count'=>array('$sum'=>1)
]; ];
$count = $collection->aggregate($aggregate1)->toArray(); $count = $collection->aggregate($aggregate1)->toArray();
if (isset($count[0])){ if (isset($count[0])){
...@@ -858,6 +864,49 @@ class MediaModel extends Eloquent ...@@ -858,6 +864,49 @@ class MediaModel extends Eloquent
return $flag; return $flag;
} }
public static function multiplySetMediaNum($request){
try{
$media_ids = $request->media_ids;
//$flag = MediaModel::whereIn("_id",$media_ids)->get($data,['multiple'=>true]);
$medias = MediaModel::whereIn("_id",$media_ids)->limit(self::$max_page_size)->get();
$multiplied = collect($medias)->map(function ($item, $key) {
return $item * 2;
});
$collection = collect([1, 2, 3, 4, 5]);
$collection->contains(function ($key, $value) {
return $value <= 5;
//true
});
$media_id = $request->media_id;
$data = [
'media_num' => md5(md5($media_id)),
];
$flag = MediaModel::whereIn("_id",$media_id)->update($data,['multiple'=>true]);
}catch (\Exception $exception){
throw new DatabaseException($exception->getMessage());
}
return $flag;
}
/** /**
* 根据媒资编号获取媒资随机码 * 根据媒资编号获取媒资随机码
* @param $request * @param $request
...@@ -902,6 +951,10 @@ class MediaModel extends Eloquent ...@@ -902,6 +951,10 @@ class MediaModel extends Eloquent
$url = getRbac($request,$call_back,$mediaCatg['media_category_id'] ,$type='clear_cache'); $url = getRbac($request,$call_back,$mediaCatg['media_category_id'] ,$type='clear_cache');
http_request_code($url,null,'POST',['mediaId'=>$media_id]); http_request_code($url,null,'POST',['mediaId'=>$media_id]);
}catch (\Exception $exception){ }catch (\Exception $exception){
throw new DatabaseException($exception->getMessage()); throw new DatabaseException($exception->getMessage());
} }
...@@ -953,4 +1006,82 @@ class MediaModel extends Eloquent ...@@ -953,4 +1006,82 @@ class MediaModel extends Eloquent
return $result['data']; return $result['data'];
} }
/**
* @param $request
* @param string $media_ids
* @return array
* @throws DatabaseException
*/
public static function batchGetMediaForverM3u8($request,array $orginal_data){
try{
$ids = implode(',',array_keys($orginal_data));
#生成批量处理地址
$url = getRbac($request,'video/infos','' ,$type='mul_play_m3u8');
$res = http_request_code($url,null,'POST',array('mediaIds'=>$ids));
$result = json_decode($res,true);
if (empty($result)){
return [];
}
if ($result['code'] != 0){
LogModel::addlog($result);
throw new \Exception("获取数据失败");
}
return self::mediaExportFormat($result['data'],$orginal_data);
}catch (\Exception $exception){
throw new DatabaseException($exception->getMessage());
}
}
/**
* 构造导出数据格式
* @param array $data
* @param $media_ids
* @return mixed
*/
private static function mediaExportFormat(array $data,$orginal_data){
foreach ($orginal_data as $key => &$item){
if (empty($data[$key])){
$item['media_id'] = $key;
$item['media_name'] = '未查到相关数据';
$item['forvery_url'] = '未查到相关数据';
$item['is_full_url'] = "未查到相关数据";
}else{
$media_id = $item['media_id'];
$media = MediaModel::select('media_name')->where('_id',$media_id)->first();
$media_num = md5(md5($media_id));
$item['media_name'] = $media['media_name'];
$tmp = [
'media_num' => $media_num,
];
MediaModel::where("_id",$media_id)->update($tmp);
$url = getenv('preview_domain')?getenv('preview_domain'):"https://xue.t.eoffcn.com/preview/temp/";
$item['forvery_url'] = $data[$key]['url'];
$item['is_full_url'] = $url."player".'/'.$media_num;
}
}
return $orginal_data;
}
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace App\Model; namespace App\Model;
use App\Exceptions\DatabaseException; use App\Exceptions\DatabaseException;
use Carbon\Carbon;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Jenssegers\Mongodb\Auth\User as Authenticatable; use Jenssegers\Mongodb\Auth\User as Authenticatable;
...@@ -46,10 +47,9 @@ class UserModel extends Authenticatable ...@@ -46,10 +47,9 @@ class UserModel extends Authenticatable
} }
$users = DB::connection('mongodb')->collection('users')->where($where) $users = DB::connection('mongodb')->collection('users')->where($where)
->where("is_del","!=",1)
->paginate(10); ->paginate(10);
// foreach ( $users as $user){ // foreach ( $users as $user){
// $idArr = ($user['_id'])->jsonSerialize(); // $idArr = ($user['_id'])->jsonSerialize();
// $user['_id'] = $idArr['$oid']; // $user['_id'] = $idArr['$oid'];
...@@ -111,9 +111,7 @@ class UserModel extends Authenticatable ...@@ -111,9 +111,7 @@ class UserModel extends Authenticatable
* @return mixed * @return mixed
* @throws DatabaseException * @throws DatabaseException
*/ */
public static function createOrUpdateUser($request){ public static function createOrUpdateUser($request,$id){
$id = $request->id;
try{ try{
$user = UserModel::find($id); $user = UserModel::find($id);
...@@ -147,9 +145,9 @@ class UserModel extends Authenticatable ...@@ -147,9 +145,9 @@ class UserModel extends Authenticatable
if (empty($user)){ if (empty($user)){
throw new \Exception('用户不存在'); throw new \Exception('用户不存在');
} }
$flag = UserModel::where('_id',$id)->delete(); $flag = UserModel::where('_id',$id)->update(["is_del"=>1]);
RecycleModel::addRecycle($id,"users"); //RecycleModel::addRecycle($id,"user");
}catch (\Exception $exception){ }catch (\Exception $exception){
throw new \Exception($exception->getMessage()); throw new \Exception($exception->getMessage());
...@@ -171,13 +169,13 @@ class UserModel extends Authenticatable ...@@ -171,13 +169,13 @@ class UserModel extends Authenticatable
if (!empty($user)){ if (!empty($user)){
throw new \Exception("用户已存在"); throw new \Exception("用户已存在");
} }
$create_time = new UTCDateTime(time() * 1000);
$data = [ $data = [
'name' => $request->name, 'name' => $request->name,
'password' => md5($request->password), 'password' => md5($request->password),
'organization_id' => 0, 'organization_id' => 0,
'status' => 0, 'status' => 0,
'create_time' => date('Y-m-d H:i:s',time()), 'create_time' => $create_time,
'user_type' => 1 'user_type' => 1
]; ];
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"jenssegers/mongodb": "^3.4.1", "jenssegers/mongodb": "^3.4.1",
"laravel/framework": "5.7.*", "laravel/framework": "5.7.*",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"maatwebsite/excel": "^3.1",
"qiniu/php-sdk": "^7.2" "qiniu/php-sdk": "^7.2"
}, },
"require-dev": { "require-dev": {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "7214d6941783eda5b5d4a23e562f5e10", "content-hash": "c11c36ddc9f2a653313606fd8eabe31d",
"packages": [ "packages": [
{ {
"name": "aliyuncs/oss-sdk-php", "name": "aliyuncs/oss-sdk-php",
...@@ -379,6 +379,56 @@ ...@@ -379,6 +379,56 @@
"time": "2019-12-30T22:54:17+00:00" "time": "2019-12-30T22:54:17+00:00"
}, },
{ {
"name": "ezyang/htmlpurifier",
"version": "v4.13.0",
"source": {
"type": "git",
"url": "https://github.com/ezyang/htmlpurifier.git",
"reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
"reference": "08e27c97e4c6ed02f37c5b2b20488046c8d90d75",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"simpletest/simpletest": "dev-master#72de02a7b80c6bb8864ef9bf66d41d2f58f826bd"
},
"type": "library",
"autoload": {
"psr-0": {
"HTMLPurifier": "library/"
},
"files": [
"library/HTMLPurifier.composer.php"
],
"exclude-from-classmap": [
"/library/HTMLPurifier/Language/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1-or-later"
],
"authors": [
{
"name": "Edward Z. Yang",
"email": "admin@htmlpurifier.org",
"homepage": "http://ezyang.com"
}
],
"description": "Standards compliant HTML filter written in PHP",
"homepage": "http://htmlpurifier.org/",
"keywords": [
"html"
],
"time": "2020-06-29T00:56:53+00:00"
},
{
"name": "fideloper/proxy", "name": "fideloper/proxy",
"version": "4.3.0", "version": "4.3.0",
"source": { "source": {
...@@ -1417,6 +1467,296 @@ ...@@ -1417,6 +1467,296 @@
"time": "2020-05-18T15:13:39+00:00" "time": "2020-05-18T15:13:39+00:00"
}, },
{ {
"name": "maatwebsite/excel",
"version": "3.1.25",
"source": {
"type": "git",
"url": "https://github.com/Maatwebsite/Laravel-Excel.git",
"reference": "a3e56f1a60e49f21798fd242a3b3d2f4051eeda7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/a3e56f1a60e49f21798fd242a3b3d2f4051eeda7",
"reference": "a3e56f1a60e49f21798fd242a3b3d2f4051eeda7",
"shasum": ""
},
"require": {
"ext-json": "*",
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0",
"php": "^7.0",
"phpoffice/phpspreadsheet": "^1.14"
},
"require-dev": {
"orchestra/testbench": "^6.0",
"predis/predis": "^1.1"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Maatwebsite\\Excel\\ExcelServiceProvider"
],
"aliases": {
"Excel": "Maatwebsite\\Excel\\Facades\\Excel"
}
}
},
"autoload": {
"psr-4": {
"Maatwebsite\\Excel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Patrick Brouwers",
"email": "patrick@maatwebsite.nl"
}
],
"description": "Supercharged Excel exports and imports in Laravel",
"keywords": [
"PHPExcel",
"batch",
"csv",
"excel",
"export",
"import",
"laravel",
"php",
"phpspreadsheet"
],
"time": "2020-11-13T10:37:36+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "2.1.0",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58",
"reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58",
"shasum": ""
},
"require": {
"myclabs/php-enum": "^1.5",
"php": ">= 7.1",
"psr/http-message": "^1.0",
"symfony/polyfill-mbstring": "^1.0"
},
"require-dev": {
"ext-zip": "*",
"guzzlehttp/guzzle": ">= 6.3",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": ">= 7.5"
},
"type": "library",
"autoload": {
"psr-4": {
"ZipStream\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Duncan",
"email": "pabs@pablotron.org"
},
{
"name": "Jonatan Männchen",
"email": "jonatan@maennchen.ch"
},
{
"name": "Jesse Donat",
"email": "donatj@gmail.com"
},
{
"name": "András Kolesár",
"email": "kolesar@kolesar.hu"
}
],
"description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
"keywords": [
"stream",
"zip"
],
"time": "2020-05-30T13:11:16+00:00"
},
{
"name": "markbaker/complex",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPComplex.git",
"reference": "9999f1432fae467bc93c53f357105b4c31bb994c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9999f1432fae467bc93c53f357105b4c31bb994c",
"reference": "9999f1432fae467bc93c53f357105b4c31bb994c",
"shasum": ""
},
"require": {
"php": "^7.2 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.4"
},
"type": "library",
"autoload": {
"psr-4": {
"Complex\\": "classes/src/"
},
"files": [
"classes/src/functions/abs.php",
"classes/src/functions/acos.php",
"classes/src/functions/acosh.php",
"classes/src/functions/acot.php",
"classes/src/functions/acoth.php",
"classes/src/functions/acsc.php",
"classes/src/functions/acsch.php",
"classes/src/functions/argument.php",
"classes/src/functions/asec.php",
"classes/src/functions/asech.php",
"classes/src/functions/asin.php",
"classes/src/functions/asinh.php",
"classes/src/functions/atan.php",
"classes/src/functions/atanh.php",
"classes/src/functions/conjugate.php",
"classes/src/functions/cos.php",
"classes/src/functions/cosh.php",
"classes/src/functions/cot.php",
"classes/src/functions/coth.php",
"classes/src/functions/csc.php",
"classes/src/functions/csch.php",
"classes/src/functions/exp.php",
"classes/src/functions/inverse.php",
"classes/src/functions/ln.php",
"classes/src/functions/log2.php",
"classes/src/functions/log10.php",
"classes/src/functions/negative.php",
"classes/src/functions/pow.php",
"classes/src/functions/rho.php",
"classes/src/functions/sec.php",
"classes/src/functions/sech.php",
"classes/src/functions/sin.php",
"classes/src/functions/sinh.php",
"classes/src/functions/sqrt.php",
"classes/src/functions/tan.php",
"classes/src/functions/tanh.php",
"classes/src/functions/theta.php",
"classes/src/operations/add.php",
"classes/src/operations/subtract.php",
"classes/src/operations/multiply.php",
"classes/src/operations/divideby.php",
"classes/src/operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@lange.demon.co.uk"
}
],
"description": "PHP Class for working with complex numbers",
"homepage": "https://github.com/MarkBaker/PHPComplex",
"keywords": [
"complex",
"mathematics"
],
"time": "2020-08-26T10:42:07+00:00"
},
{
"name": "markbaker/matrix",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/MarkBaker/PHPMatrix.git",
"reference": "361c0f545c3172ee26c3d596a0aa03f0cef65e6a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/361c0f545c3172ee26c3d596a0aa03f0cef65e6a",
"reference": "361c0f545c3172ee26c3d596a0aa03f0cef65e6a",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"phpcompatibility/php-compatibility": "^9.0",
"phpdocumentor/phpdocumentor": "2.*",
"phploc/phploc": "^4.0",
"phpmd/phpmd": "2.*",
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
"sebastian/phpcpd": "^4.0",
"squizlabs/php_codesniffer": "^3.4"
},
"type": "library",
"autoload": {
"psr-4": {
"Matrix\\": "classes/src/"
},
"files": [
"classes/src/Functions/adjoint.php",
"classes/src/Functions/antidiagonal.php",
"classes/src/Functions/cofactors.php",
"classes/src/Functions/determinant.php",
"classes/src/Functions/diagonal.php",
"classes/src/Functions/identity.php",
"classes/src/Functions/inverse.php",
"classes/src/Functions/minors.php",
"classes/src/Functions/trace.php",
"classes/src/Functions/transpose.php",
"classes/src/Operations/add.php",
"classes/src/Operations/directsum.php",
"classes/src/Operations/subtract.php",
"classes/src/Operations/multiply.php",
"classes/src/Operations/divideby.php",
"classes/src/Operations/divideinto.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Mark Baker",
"email": "mark@demon-angel.eu"
}
],
"description": "PHP Class for working with matrices",
"homepage": "https://github.com/MarkBaker/PHPMatrix",
"keywords": [
"mathematics",
"matrix",
"vector"
],
"time": "2021-01-23T16:37:31+00:00"
},
{
"name": "mongodb/mongodb", "name": "mongodb/mongodb",
"version": "1.6.0", "version": "1.6.0",
"source": { "source": {
...@@ -1562,6 +1902,52 @@ ...@@ -1562,6 +1902,52 @@
"time": "2020-05-22T07:31:27+00:00" "time": "2020-05-22T07:31:27+00:00"
}, },
{ {
"name": "myclabs/php-enum",
"version": "1.7.7",
"source": {
"type": "git",
"url": "https://github.com/myclabs/php-enum.git",
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7",
"reference": "d178027d1e679832db9f38248fcc7200647dc2b7",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "^7",
"squizlabs/php_codesniffer": "1.*",
"vimeo/psalm": "^3.8"
},
"type": "library",
"autoload": {
"psr-4": {
"MyCLabs\\Enum\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP Enum contributors",
"homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
}
],
"description": "PHP Enum implementation",
"homepage": "http://github.com/myclabs/php-enum",
"keywords": [
"enum"
],
"time": "2020-11-14T18:14:52+00:00"
},
{
"name": "nesbot/carbon", "name": "nesbot/carbon",
"version": "1.39.1", "version": "1.39.1",
"source": { "source": {
...@@ -2040,6 +2426,103 @@ ...@@ -2040,6 +2426,103 @@
"time": "2016-01-26T13:27:02+00:00" "time": "2016-01-26T13:27:02+00:00"
}, },
{ {
"name": "phpoffice/phpspreadsheet",
"version": "1.17.1",
"source": {
"type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "c55269cb06911575a126dc225a05c0e4626e5fb4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/c55269cb06911575a126dc225a05c0e4626e5fb4",
"reference": "c55269cb06911575a126dc225a05c0e4626e5fb4",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-gd": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"ext-xmlreader": "*",
"ext-xmlwriter": "*",
"ext-zip": "*",
"ext-zlib": "*",
"ezyang/htmlpurifier": "^4.13",
"maennchen/zipstream-php": "^2.1",
"markbaker/complex": "^1.5||^2.0",
"markbaker/matrix": "^1.2||^2.0",
"php": "^7.2||^8.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"dompdf/dompdf": "^0.8.5",
"friendsofphp/php-cs-fixer": "^2.18",
"jpgraph/jpgraph": "^4.0",
"mpdf/mpdf": "^8.0",
"phpcompatibility/php-compatibility": "^9.3",
"phpunit/phpunit": "^8.5||^9.3",
"squizlabs/php_codesniffer": "^3.5",
"tecnickcom/tcpdf": "^6.3"
},
"suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)",
"jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)"
},
"type": "library",
"autoload": {
"psr-4": {
"PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Maarten Balliauw",
"homepage": "https://blog.maartenballiauw.be"
},
{
"name": "Mark Baker",
"homepage": "https://markbakeruk.net"
},
{
"name": "Franck Lefevre",
"homepage": "https://rootslabs.net"
},
{
"name": "Erik Tilt"
},
{
"name": "Adrien Crivelli"
}
],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
"homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
"keywords": [
"OpenXML",
"excel",
"gnumeric",
"ods",
"php",
"spreadsheet",
"xls",
"xlsx"
],
"time": "2021-03-02T17:54:11+00:00"
},
{
"name": "psr/container", "name": "psr/container",
"version": "1.0.0", "version": "1.0.0",
"source": { "source": {
...@@ -2089,6 +2572,55 @@ ...@@ -2089,6 +2572,55 @@
"time": "2017-02-14T16:28:37+00:00" "time": "2017-02-14T16:28:37+00:00"
}, },
{ {
"name": "psr/http-client",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-client.git",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
"shasum": ""
},
"require": {
"php": "^7.0 || ^8.0",
"psr/http-message": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP clients",
"homepage": "https://github.com/php-fig/http-client",
"keywords": [
"http",
"http-client",
"psr",
"psr-18"
],
"time": "2020-06-29T06:28:15+00:00"
},
{
"name": "psr/http-factory", "name": "psr/http-factory",
"version": "1.0.1", "version": "1.0.1",
"source": { "source": {
...@@ -5286,6 +5818,7 @@ ...@@ -5286,6 +5818,7 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"abandoned": true,
"time": "2019-09-17T06:23:10+00:00" "time": "2019-09-17T06:23:10+00:00"
}, },
{ {
......
...@@ -182,6 +182,7 @@ return [ ...@@ -182,6 +182,7 @@ return [
* 自定义 * 自定义
*/ */
Jenssegers\Mongodb\MongodbServiceProvider::class, Jenssegers\Mongodb\MongodbServiceProvider::class,
Maatwebsite\Excel\ExcelServiceProvider::class,
], ],
...@@ -239,6 +240,7 @@ return [ ...@@ -239,6 +240,7 @@ return [
*/ */
'Mongo' => Jenssegers\Mongodb\MongodbServiceProvider::class, 'Mongo' => Jenssegers\Mongodb\MongodbServiceProvider::class,
'Moloquent' => 'Jenssegers\Mongodb\Eloquent\Model', 'Moloquent' => 'Jenssegers\Mongodb\Eloquent\Model',
'Excel' => Maatwebsite\Excel\Facades\Excel::class,
], ],
......
<?php
use Maatwebsite\Excel\Excel;
return [
'exports' => [
/*
|--------------------------------------------------------------------------
| Chunk size
|--------------------------------------------------------------------------
|
| When using FromQuery, the query is automatically chunked.
| Here you can specify how big the chunk should be.
|
*/
'chunk_size' => 1000,
/*
|--------------------------------------------------------------------------
| Pre-calculate formulas during export
|--------------------------------------------------------------------------
*/
'pre_calculate_formulas' => false,
/*
|--------------------------------------------------------------------------
| Enable strict null comparison
|--------------------------------------------------------------------------
|
| When enabling strict null comparison empty cells ('') will
| be added to the sheet.
*/
'strict_null_comparison' => false,
/*
|--------------------------------------------------------------------------
| CSV Settings
|--------------------------------------------------------------------------
|
| Configure e.g. delimiter, enclosure and line ending for CSV exports.
|
*/
'csv' => [
'delimiter' => ',',
'enclosure' => '"',
'line_ending' => PHP_EOL,
'use_bom' => false,
'include_separator_line' => false,
'excel_compatibility' => false,
],
/*
|--------------------------------------------------------------------------
| Worksheet properties
|--------------------------------------------------------------------------
|
| Configure e.g. default title, creator, subject,...
|
*/
'properties' => [
'creator' => '',
'lastModifiedBy' => '',
'title' => '',
'description' => '',
'subject' => '',
'keywords' => '',
'category' => '',
'manager' => '',
'company' => '',
],
],
'imports' => [
/*
|--------------------------------------------------------------------------
| Read Only
|--------------------------------------------------------------------------
|
| When dealing with imports, you might only be interested in the
| data that the sheet exists. By default we ignore all styles,
| however if you want to do some logic based on style data
| you can enable it by setting read_only to false.
|
*/
'read_only' => true,
/*
|--------------------------------------------------------------------------
| Ignore Empty
|--------------------------------------------------------------------------
|
| When dealing with imports, you might be interested in ignoring
| rows that have null values or empty strings. By default rows
| containing empty strings or empty values are not ignored but can be
| ignored by enabling the setting ignore_empty to true.
|
*/
'ignore_empty' => false,
/*
|--------------------------------------------------------------------------
| Heading Row Formatter
|--------------------------------------------------------------------------
|
| Configure the heading row formatter.
| Available options: none|slug|custom
|
*/
'heading_row' => [
'formatter' => 'custom',
],
/*
|--------------------------------------------------------------------------
| CSV Settings
|--------------------------------------------------------------------------
|
| Configure e.g. delimiter, enclosure and line ending for CSV imports.
|
*/
'csv' => [
'delimiter' => ',',
'enclosure' => '"',
'escape_character' => '\\',
'contiguous' => false,
'input_encoding' => 'UTF-8',
],
/*
|--------------------------------------------------------------------------
| Worksheet properties
|--------------------------------------------------------------------------
|
| Configure e.g. default title, creator, subject,...
|
*/
'properties' => [
'creator' => '',
'lastModifiedBy' => '',
'title' => '',
'description' => '',
'subject' => '',
'keywords' => '',
'category' => '',
'manager' => '',
'company' => '',
],
],
/*
|--------------------------------------------------------------------------
| Extension detector
|--------------------------------------------------------------------------
|
| Configure here which writer/reader type should be used when the package
| needs to guess the correct type based on the extension alone.
|
*/
'extension_detector' => [
'xlsx' => Excel::XLSX,
'xlsm' => Excel::XLSX,
'xltx' => Excel::XLSX,
'xltm' => Excel::XLSX,
'xls' => Excel::XLS,
'xlt' => Excel::XLS,
'ods' => Excel::ODS,
'ots' => Excel::ODS,
'slk' => Excel::SLK,
'xml' => Excel::XML,
'gnumeric' => Excel::GNUMERIC,
'htm' => Excel::HTML,
'html' => Excel::HTML,
'csv' => Excel::CSV,
'tsv' => Excel::TSV,
/*
|--------------------------------------------------------------------------
| PDF Extension
|--------------------------------------------------------------------------
|
| Configure here which Pdf driver should be used by default.
| Available options: Excel::MPDF | Excel::TCPDF | Excel::DOMPDF
|
*/
'pdf' => Excel::DOMPDF,
],
/*
|--------------------------------------------------------------------------
| Value Binder
|--------------------------------------------------------------------------
|
| PhpSpreadsheet offers a way to hook into the process of a value being
| written to a cell. In there some assumptions are made on how the
| value should be formatted. If you want to change those defaults,
| you can implement your own default value binder.
|
| Possible value binders:
|
| [x] Maatwebsite\Excel\DefaultValueBinder::class
| [x] PhpOffice\PhpSpreadsheet\Cell\StringValueBinder::class
| [x] PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class
|
*/
'value_binder' => [
'default' => Maatwebsite\Excel\DefaultValueBinder::class,
],
'cache' => [
/*
|--------------------------------------------------------------------------
| Default cell caching driver
|--------------------------------------------------------------------------
|
| By default PhpSpreadsheet keeps all cell values in memory, however when
| dealing with large files, this might result into memory issues. If you
| want to mitigate that, you can configure a cell caching driver here.
| When using the illuminate driver, it will store each value in a the
| cache store. This can slow down the process, because it needs to
| store each value. You can use the "batch" store if you want to
| only persist to the store when the memory limit is reached.
|
| Drivers: memory|illuminate|batch
|
*/
'driver' => 'memory',
/*
|--------------------------------------------------------------------------
| Batch memory caching
|--------------------------------------------------------------------------
|
| When dealing with the "batch" caching driver, it will only
| persist to the store when the memory limit is reached.
| Here you can tweak the memory limit to your liking.
|
*/
'batch' => [
'memory_limit' => 60000,
],
/*
|--------------------------------------------------------------------------
| Illuminate cache
|--------------------------------------------------------------------------
|
| When using the "illuminate" caching driver, it will automatically use
| your default cache store. However if you prefer to have the cell
| cache on a separate store, you can configure the store name here.
| You can use any store defined in your cache config. When leaving
| at "null" it will use the default store.
|
*/
'illuminate' => [
'store' => null,
],
],
/*
|--------------------------------------------------------------------------
| Transaction Handler
|--------------------------------------------------------------------------
|
| By default the import is wrapped in a transaction. This is useful
| for when an import may fail and you want to retry it. With the
| transactions, the previous import gets rolled-back.
|
| You can disable the transaction handler by setting this to null.
| Or you can choose a custom made transaction handler here.
|
| Supported handlers: null|db
|
*/
'transactions' => [
'handler' => 'null',
],
'temporary_files' => [
/*
|--------------------------------------------------------------------------
| Local Temporary Path
|--------------------------------------------------------------------------
|
| When exporting and importing files, we use a temporary file, before
| storing reading or downloading. Here you can customize that path.
|
*/
'local_path' => storage_path('framework/laravel-excel'),
/*
|--------------------------------------------------------------------------
| Remote Temporary Disk
|--------------------------------------------------------------------------
|
| When dealing with a multi server setup with queues in which you
| cannot rely on having a shared local temporary path, you might
| want to store the temporary file on a shared disk. During the
| queue executing, we'll retrieve the temporary file from that
| location instead. When left to null, it will always use
| the local path. This setting only has effect when using
| in conjunction with queued imports and exports.
|
*/
'remote_disk' => null,
'remote_prefix' => null,
/*
|--------------------------------------------------------------------------
| Force Resync
|--------------------------------------------------------------------------
|
| When dealing with a multi server setup as above, it's possible
| for the clean up that occurs after entire queue has been run to only
| cleanup the server that the last AfterImportJob runs on. The rest of the server
| would still have the local temporary file stored on it. In this case your
| local storage limits can be exceeded and future imports won't be processed.
| To mitigate this you can set this config value to be true, so that after every
| queued chunk is processed the local temporary file is deleted on the server that
| processed it.
|
*/
'force_resync_remote' => null,
],
];
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"sort": 1, "sort": 1,
"key_name": "member_manager_block", "key_name": "member_manager_block",
"son": [{ "son": [{
"id": 10, "id": 201,
"pid": 2, "pid": 2,
"name": "修改密码", "name": "修改密码",
"icon": "", "icon": "",
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"sort": 25, "sort": 25,
"key_name": "member_modify_pwd" "key_name": "member_modify_pwd"
}, { }, {
"id": 9, "id": 202,
"pid": 2, "pid": 2,
"name": " 用户列表", "name": " 用户列表",
"icon": "", "icon": "",
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"sort": 25, "sort": 25,
"key_name": "member_manager" "key_name": "member_manager"
}, { }, {
"id": 8, "id": 203,
"pid": 2, "pid": 2,
"name": "会员删除", "name": "会员删除",
"icon": "", "icon": "",
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
"sort": 25, "sort": 25,
"key_name": "member_destroy" "key_name": "member_destroy"
}, { }, {
"id": 7, "id": 204,
"pid": 2, "pid": 2,
"name": "会员启用-停用", "name": "会员启用-停用",
"icon": "", "icon": "",
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"sort": 25, "sort": 25,
"key_name": "member_disable" "key_name": "member_disable"
}, { }, {
"id": 6, "id": 205,
"pid": 2, "pid": 2,
"name": "编辑保存", "name": "编辑保存",
"icon": "", "icon": "",
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
"sort": 25, "sort": 25,
"key_name": "member_update" "key_name": "member_update"
}, { }, {
"id": 5, "id": 206,
"pid": 2, "pid": 2,
"name": "会员编辑", "name": "会员编辑",
"icon": "", "icon": "",
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
"sort": 25, "sort": 25,
"key_name": "member_edit" "key_name": "member_edit"
}, { }, {
"id": 4, "id": 207,
"pid": 2, "pid": 2,
"name": "添加保存", "name": "添加保存",
"icon": "", "icon": "",
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
"sort": 25, "sort": 25,
"key_name": "member_add" "key_name": "member_add"
}, { }, {
"id": 3, "id": 208,
"pid": 2, "pid": 2,
"name": "会员添加", "name": "会员添加",
"icon": "", "icon": "",
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
"sort": 2, "sort": 2,
"key_name": "manager_media", "key_name": "manager_media",
"son": [{ "son": [{
"id": 15, "id": 1101,
"pid": 11, "pid": 11,
"name": "媒资列表", "name": "媒资列表",
"icon": "", "icon": "",
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
"sort": 25, "sort": 25,
"key_name": "media_model_list" "key_name": "media_model_list"
},{ },{
"id": 23, "id": 1102,
"pid": 11, "pid": 11,
"name": "媒资删除", "name": "媒资删除",
"icon": "", "icon": "",
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
"sort": 25, "sort": 25,
"key_name": "media_model_destroy" "key_name": "media_model_destroy"
}, { }, {
"id": 22, "id": 1103,
"pid": 11, "pid": 11,
"name": "媒资添加保存", "name": "媒资添加保存",
"icon": "", "icon": "",
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
"sort": 25, "sort": 25,
"key_name": "media_store" "key_name": "media_store"
}, { }, {
"id": 21, "id": 1104,
"pid": 11, "pid": 11,
"name": "媒资修改保存", "name": "媒资修改保存",
"icon": "", "icon": "",
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
"sort": 25, "sort": 25,
"key_name": "media_update" "key_name": "media_update"
}, { }, {
"id": 18, "id": 1105,
"pid": 11, "pid": 11,
"name": "媒资编辑", "name": "媒资编辑",
"icon": "", "icon": "",
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
"sort": 25, "sort": 25,
"key_name": "media_edit" "key_name": "media_edit"
}, { }, {
"id": 17, "id": 1106,
"pid": 11, "pid": 11,
"name": "媒资添加", "name": "媒资添加",
"icon": "", "icon": "",
...@@ -175,6 +175,18 @@ ...@@ -175,6 +175,18 @@
"show": 0, "show": 0,
"sort": 25, "sort": 25,
"key_name": "media_create" "key_name": "media_create"
}, {
"id": 1107,
"pid": 11,
"name": "媒资批处理",
"icon": "",
"link": "/media_manager/batch_media",
"slug": "media_manager.batch_media",
"description": "",
"show": 1,
"sort": 25,
"key_name": "batch_media",
"have":1
}] }]
},{ },{
"id": 3, "id": 3,
...@@ -188,7 +200,7 @@ ...@@ -188,7 +200,7 @@
"sort": 2, "sort": 2,
"key_name": "media_category", "key_name": "media_category",
"son": [{ "son": [{
"id": 31, "id": 301,
"pid": 3, "pid": 3,
"name": "媒资类别列表", "name": "媒资类别列表",
"icon": "", "icon": "",
...@@ -199,7 +211,7 @@ ...@@ -199,7 +211,7 @@
"sort": 25, "sort": 25,
"key_name": "media_list" "key_name": "media_list"
},{ },{
"id": 31, "id": 302,
"pid": 3, "pid": 3,
"name": "媒资类别删除", "name": "媒资类别删除",
"icon": "", "icon": "",
...@@ -210,7 +222,7 @@ ...@@ -210,7 +222,7 @@
"sort": 25, "sort": 25,
"key_name": "media_destroy" "key_name": "media_destroy"
}, { }, {
"id": 33, "id": 303,
"pid": 3, "pid": 3,
"name": "媒资类别添加保存", "name": "媒资类别添加保存",
"icon": "", "icon": "",
...@@ -221,7 +233,7 @@ ...@@ -221,7 +233,7 @@
"sort": 25, "sort": 25,
"key_name": "media_store" "key_name": "media_store"
}, { }, {
"id": 34, "id": 304,
"pid": 3, "pid": 3,
"name": "媒资类别修改保存", "name": "媒资类别修改保存",
"icon": "", "icon": "",
...@@ -232,7 +244,7 @@ ...@@ -232,7 +244,7 @@
"sort": 25, "sort": 25,
"key_name": "media_update" "key_name": "media_update"
}, { }, {
"id": 35, "id": 305,
"pid": 3, "pid": 3,
"name": "媒资类别编辑", "name": "媒资类别编辑",
"icon": "", "icon": "",
...@@ -243,7 +255,7 @@ ...@@ -243,7 +255,7 @@
"sort": 25, "sort": 25,
"key_name": "media_edit" "key_name": "media_edit"
}, { }, {
"id": 36, "id": 306,
"pid": 3, "pid": 3,
"name": "媒资类别添加", "name": "媒资类别添加",
"icon": "", "icon": "",
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"sort": 1, "sort": 1,
"key_name": "member_manager_block", "key_name": "member_manager_block",
"son": [{ "son": [{
"id": 10, "id": 201,
"pid": 2, "pid": 2,
"name": "修改密码", "name": "修改密码",
"icon": "", "icon": "",
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"key_name": "member_modify_pwd" "key_name": "member_modify_pwd"
}, { }, {
"id": 9, "id": 9,
"pid": 2, "pid": 202,
"name": " 用户列表", "name": " 用户列表",
"icon": "", "icon": "",
"link": "/member", "link": "/member",
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"sort": 25, "sort": 25,
"key_name": "member_manager" "key_name": "member_manager"
}, { }, {
"id": 8, "id": 203,
"pid": 2, "pid": 2,
"name": "会员删除", "name": "会员删除",
"icon": "", "icon": "",
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
"sort": 25, "sort": 25,
"key_name": "member_destroy" "key_name": "member_destroy"
}, { }, {
"id": 7, "id": 204,
"pid": 2, "pid": 2,
"name": "会员启用-停用", "name": "会员启用-停用",
"icon": "", "icon": "",
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"sort": 25, "sort": 25,
"key_name": "member_disable" "key_name": "member_disable"
}, { }, {
"id": 6, "id": 205,
"pid": 2, "pid": 2,
"name": "编辑保存", "name": "编辑保存",
"icon": "", "icon": "",
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
"sort": 25, "sort": 25,
"key_name": "member_update" "key_name": "member_update"
}, { }, {
"id": 5, "id": 206,
"pid": 2, "pid": 2,
"name": "会员编辑", "name": "会员编辑",
"icon": "", "icon": "",
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
"sort": 25, "sort": 25,
"key_name": "member_edit" "key_name": "member_edit"
}, { }, {
"id": 4, "id": 207,
"pid": 2, "pid": 2,
"name": "添加保存", "name": "添加保存",
"icon": "", "icon": "",
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
"sort": 25, "sort": 25,
"key_name": "member_add" "key_name": "member_add"
}, { }, {
"id": 3, "id": 208,
"pid": 2, "pid": 2,
"name": "会员添加", "name": "会员添加",
"icon": "", "icon": "",
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
"key_name": "manager_media", "key_name": "manager_media",
"have":1, "have":1,
"son": [{ "son": [{
"id": 15, "id": 1101,
"pid": 11, "pid": 11,
"name": "媒资列表", "name": "媒资列表",
"icon": "", "icon": "",
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
"is_show":1, "is_show":1,
"have":1 "have":1
},{ },{
"id": 23, "id": 1102,
"pid": 11, "pid": 11,
"name": "媒资删除", "name": "媒资删除",
"icon": "", "icon": "",
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
"is_show":0, "is_show":0,
"have":0 "have":0
}, { }, {
"id": 22, "id": 1103,
"pid": 11, "pid": 11,
"name": "媒资添加保存", "name": "媒资添加保存",
"icon": "", "icon": "",
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
"key_name": "media_store", "key_name": "media_store",
"have":0 "have":0
}, { }, {
"id": 21, "id": 1104,
"pid": 11, "pid": 11,
"name": "媒资修改保存", "name": "媒资修改保存",
"icon": "", "icon": "",
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
"key_name": "media_update", "key_name": "media_update",
"have":0 "have":0
}, { }, {
"id": 18, "id": 1105,
"pid": 11, "pid": 11,
"name": "媒资编辑", "name": "媒资编辑",
"icon": "", "icon": "",
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
"key_name": "media_edit", "key_name": "media_edit",
"have":0 "have":0
}, { }, {
"id": 17, "id": 1106,
"pid": 11, "pid": 11,
"name": "媒资添加", "name": "媒资添加",
"icon": "", "icon": "",
...@@ -184,6 +184,18 @@ ...@@ -184,6 +184,18 @@
"sort": 25, "sort": 25,
"key_name": "media_create", "key_name": "media_create",
"have":0 "have":0
}, {
"id": 1107,
"pid": 11,
"name": "媒资批处理",
"icon": "",
"link": "/media_manager/batch_media",
"slug": "media_manager.batch_media",
"description": "",
"show": 1,
"sort": 25,
"key_name": "batch_media",
"have":1
}] }]
},{ },{
"id": 3, "id": 3,
...@@ -196,9 +208,8 @@ ...@@ -196,9 +208,8 @@
"show": 0, "show": 0,
"sort": 2, "sort": 2,
"key_name": "media_category", "key_name": "media_category",
"have":0,
"son": [{ "son": [{
"id": 31, "id": 301,
"pid": 3, "pid": 3,
"name": "媒资类别列表", "name": "媒资类别列表",
"icon": "", "icon": "",
...@@ -207,9 +218,10 @@ ...@@ -207,9 +218,10 @@
"description": "", "description": "",
"show": 1, "show": 1,
"sort": 25, "sort": 25,
"key_name": "media_list" "key_name": "media_list",
"have":1
},{ },{
"id": 31, "id": 302,
"pid": 3, "pid": 3,
"name": "媒资类别删除", "name": "媒资类别删除",
"icon": "", "icon": "",
...@@ -218,9 +230,10 @@ ...@@ -218,9 +230,10 @@
"description": "", "description": "",
"show": 0, "show": 0,
"sort": 25, "sort": 25,
"key_name": "media_destroy" "key_name": "media_destroy",
"have":1
}, { }, {
"id": 33, "id": 303,
"pid": 3, "pid": 3,
"name": "媒资类别添加保存", "name": "媒资类别添加保存",
"icon": "", "icon": "",
...@@ -229,9 +242,10 @@ ...@@ -229,9 +242,10 @@
"description": "", "description": "",
"show": 0, "show": 0,
"sort": 25, "sort": 25,
"key_name": "media_store" "key_name": "media_store",
"have":1
}, { }, {
"id": 34, "id": 304,
"pid": 3, "pid": 3,
"name": "媒资类别修改保存", "name": "媒资类别修改保存",
"icon": "", "icon": "",
...@@ -240,9 +254,10 @@ ...@@ -240,9 +254,10 @@
"description": "", "description": "",
"show": 0, "show": 0,
"sort": 25, "sort": 25,
"key_name": "media_update" "key_name": "media_update",
"have":1
}, { }, {
"id": 35, "id": 305,
"pid": 3, "pid": 3,
"name": "媒资类别编辑", "name": "媒资类别编辑",
"icon": "", "icon": "",
...@@ -251,9 +266,10 @@ ...@@ -251,9 +266,10 @@
"description": "", "description": "",
"show": 0, "show": 0,
"sort": 25, "sort": 25,
"key_name": "media_edit" "key_name": "media_edit",
"have":1
}, { }, {
"id": 36, "id": 306,
"pid": 3, "pid": 3,
"name": "媒资类别添加", "name": "媒资类别添加",
"icon": "", "icon": "",
...@@ -262,10 +278,11 @@ ...@@ -262,10 +278,11 @@
"description": "", "description": "",
"show": 0, "show": 0,
"sort": 25, "sort": 25,
"key_name": "media_create" "key_name": "media_create",
"have":1
}] }]
},{ },{
"id": 2, "id": 4,
"pid": 0, "pid": 0,
"name": "权限管理", "name": "权限管理",
"icon": "&#xe623;", "icon": "&#xe623;",
......
<?php
phpinfo();
\ No newline at end of file
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
font-family: "dashboard"; font-family: "dashboard";
src:url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.eot"); src:url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.eot");
src:url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.eot?#iefix") format("embedded-opentype"), src:url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.eot?#iefix") format("embedded-opentype"),
url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.woff") format("woff"), /*url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.woff") format("woff"),*/
url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.ttf") format("truetype"), /*url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.ttf") format("truetype"),*/
url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.svg#1494891667") format("svg"); url("https://file.myfontastic.com/da58YPMQ7U5HY8Rb6UxkNf/fonts/1494891667.svg#1494891667") format("svg");
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
</div> </div>
<ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center"> <ul class="nav-menu list-unstyled d-flex flex-md-row align-items-md-center">
<!-- Expand--> <!-- Expand-->
{{--<li class="nav-item d-flex align-items-center full_scr_exp"><a class="nav-link" href="#"><img src=" {{ asset('xadmin/img/expand.png')}}" ')}}onclick="toggleFullScreen(document.body)" class="img-fluid" alt=""></a></li>--}} @if(\Illuminate\Support\Facades\Request::Input("category_id"))
<li class="nav-item d-flex"><a class="nav-link" href="javascript:;">当前店铺为:{{\Illuminate\Support\Facades\Request::all()['catetory_name']}}</a></li>
@endif
<!-- Search--> <!-- Search-->
{{--<li class="nav-item d-flex align-items-center"><a id="search" class="nav-link" href="#"><i class="icon-search"></i></a></li> {{--<li class="nav-item d-flex align-items-center"><a id="search" class="nav-link" href="#"><i class="icon-search"></i></a></li>
<li class="nav-item d-flex align-items-center"> <li class="nav-item d-flex align-items-center">
...@@ -256,6 +258,7 @@ ...@@ -256,6 +258,7 @@
</header> </header>
<script> <script>
function logout() { function logout() {
$.removeCookie('media_category_id') $.removeCookie('media_category_id')
$.removeCookie('appid') $.removeCookie('appid')
......
<!DOCTYPE html>
<html>
@include('admin.common.commonMedia')
<link rel="stylesheet" href="{{asset('xadmin/extra/date/datepicker.css')}}">
<script src="{{ asset('xadmin/extra/date/datepicker.js')}}"></script>
<script src="{{ asset('xadmin/extra/date/datepicker.zh-CN.js')}}"></script>
<body>
<!--====================================================
MAIN NAVBAR
======================================================-->
@include('admin.common.header')
<!--====================================================
PAGE CONTENT
======================================================-->
<div class="page-content d-flex align-items-stretch">
<!--***** SIDE NAVBAR *****-->
@include('admin.common.left')
<div class="content-inner chart-cont">
<div class="card form">
<div class="card-header">
<h3><i class="fa fa-user-circle"></i> 批处理</h3>
</div>
<br>
<!--***** CONTENT *****-->
<div class="row ml20 batch-list">
<form>
{{ method_field('POST')}}
<input type="hidden" name="_token" value="{{csrf_token()}}"/>
<div class="item-name">批量导出预览视频连接</div>
<div class="form-group">
<input type="file" class="btn btn-info" id="uploadFile" name="uploadFile" accept=".xls,.xlsx">
</div>
<button class="btn btn-info batch-media" type="button" id="batch-media" disabled onclick="test()" >导出</button>
</form>
<div class="muban">
<span class="btn btn-info btn-small"><a href="{{asset('/web/media_manager/export_batch_media?type=muban')}}">模板文件</a></span>
</div>
<div class="notice">
注意事项:
<ul>
<li>导入数据最多不超过200条,超出部分自动被过滤掉!</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!--Global Javascript -->
@include('admin.common.foot')
<!--Core Javascript -->
<script src="{{ asset('xadmin/extra/toast/js/toast.js')}}"></script>
<style>
.form{
min-height: 734px;
}
.batch-list{
font-size: 18px;
font-weight: 400;
}
.batch-media{
margin-top: 10px;
}
.muban{
padding-top: 30px;
padding-left: 10px;
}
.muban a{
color: #eee;
}
.notice{
padding-left: 20%;
color: #ff5f75;
font-size: 14px;
}
</style>
<script>
/**
* 点击上传文件,触发input type="file"
*/
$("#uploadFile").change(function () {
$("#batch-media").removeAttr("disabled");
var fileInput = $('#uploadFile').get(0).files[0];
if (fileInput === undefined){
$("#batch-media").attr("disabled",true);
}
})
/**
* 清空页面属性
*/
function test() {
var formData = new FormData();
formData.append("uploadFile",$("#uploadFile")[0].files[0]);
$.ajax({
url:'/web/media_manager/import_batch_media', /*接口域名地址*/
type:'post',
data: formData,
processData: false,
contentType: false,
success:function(res){
if(res.code === 200){
$('body').toast({
position: 'fixed',
content: '导入成功,数据处理中......',
duration: 3000,
top: '50%'
});
window.location.href = "/web/media_manager/download/"+res.data
}else {
$('body').toast({
position: 'fixed',
content: res.msg,
duration: 3000,
top: '50%'
});
}
$("#batch-media").attr("disabled",true);
$("#uploadFile").val("")
}
})
// $('body').toast({
// position: 'fixed',
// content: '导入成功,数据处理中......',
// duration: 3000,
// top: '50%'
// });
// setTimeout(function () {
// $("#batch-media").attr("disabled",true);
// $("#uploadFile").val("")
// }, 2000)
}
</script>
</body>
</html>
\ No newline at end of file
...@@ -54,15 +54,15 @@ ...@@ -54,15 +54,15 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label for="name">appID</label> <label for="media_category_id">appID</label>
<input type="text" class="form-control" name="media_category_id" value="{{$mediaCatg['media_category_id']}}" id="media_category_id" placeholder="appID" disabled> <input type="text" class="form-control" name="media_category_id" value="{{$mediaCatg['media_category_id']}}" id="media_category_id" placeholder="appID" readonly>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="form-group"> <div class="form-group">
<label for="is_dynamic">启用:</label> <label for="status">启用:</label>
<input type="radio" id="status" name="status" @if($mediaCatg['status']=='0') checked @endif value="0"> <input type="radio" id="status" name="status" @if($mediaCatg['status']=='0') checked @endif value="0">
<input type="radio" id="status" name="status" @if($mediaCatg['status']=='1') checked @endif value="1"> <input type="radio" id="status" name="status" @if($mediaCatg['status']=='1') checked @endif value="1">
</div> </div>
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
fetch_response('POST', "/web/media_category/{{$mediaCatg['id']}}", formdata).then(function (res) { fetch_response('POST', "/web/media_category/{{$mediaCatg['id']}}", formdata).then(function (res) {
if (res.code == 200) { if (res.code == 200) {
console.log('dsfsfsd',res)
$('body').toast({ $('body').toast({
position: 'fixed', position: 'fixed',
content: res.msg, content: res.msg,
......
...@@ -2,13 +2,7 @@ ...@@ -2,13 +2,7 @@
<html> <html>
@include('admin.common.commonMedia') @include('admin.common.commonMedia')
<link rel="stylesheet" href="{{ asset('xadmin/extra/datepicker/css/daterangepicker.css')}}">
<link rel="stylesheet" href="{{ asset('xadmin/extra/datepicker/css/htmleaf-demo.css')}}">
<script src="{{ asset('xadmin/extra/datepicker/js/moment.js')}}"></script> <script src="{{ asset('xadmin/extra/datepicker/js/moment.js')}}"></script>
<script src="{{ asset('xadmin/extra/datepicker/js/daterangepicker.js')}}"></script>
<body> <body>
<!--==================================================== <!--====================================================
...@@ -201,7 +195,7 @@ ...@@ -201,7 +195,7 @@
if(title == '停用'){ if(title == '停用'){
//发异步把用户状态进行更改 //发异步把用户状态进行更改
opts.append('id',id); opts.append('id',id);
opts.append('status',0); opts.append('status',1);
fetch_response('POST','/web/media_category/disable',opts).then(function(res){ fetch_response('POST','/web/media_category/disable',opts).then(function(res){
if(res.code == 200){ if(res.code == 200){
$(obj).attr('title','启用') $(obj).attr('title','启用')
...@@ -215,7 +209,7 @@ ...@@ -215,7 +209,7 @@
top: '50%' top: '50%'
}); });
setTimeout(function () { setTimeout(function () {
window.location.href = '/web/member'; window.location.href = '/web/media_category';
}, 2000) }, 2000)
...@@ -230,7 +224,7 @@ ...@@ -230,7 +224,7 @@
}); });
}else{ }else{
opts.append('id',id); opts.append('id',id);
opts.append('status',1); opts.append('status',0);
fetch_response('POST','/web/media_category/disable',opts).then(function(res){ fetch_response('POST','/web/media_category/disable',opts).then(function(res){
if(res.code == 200){ if(res.code == 200){
$(obj).attr('title','停用') $(obj).attr('title','停用')
......
...@@ -3,12 +3,7 @@ ...@@ -3,12 +3,7 @@
@include('admin.common.commonMedia') @include('admin.common.commonMedia')
{{--<script src="{{ asset('xadmin/extra/datepicker/js/moment.js')}}"></script>--}}
<link rel="stylesheet" href="{{ asset('xadmin/extra/datepicker/css/daterangepicker.css')}}">
<link rel="stylesheet" href="{{ asset('xadmin/extra/datepicker/css/htmleaf-demo.css')}}">
<script src="{{ asset('xadmin/extra/datepicker/js/moment.js')}}"></script>
<script src="{{ asset('xadmin/extra/datepicker/js/daterangepicker.js')}}"></script>
<body> <body>
<!--==================================================== <!--====================================================
...@@ -280,35 +275,6 @@ ...@@ -280,35 +275,6 @@
}); });
} }
updateConfig();
function updateConfig() {
var options = {};
options.locale = {
// direction: $('#rtl').is(':checked') ? 'rtl' : 'ltr',
// format: 'MM/DD/YYYY HH:mm',
format: 'YYYY/MM/DD',
separator: ' - ',
applyLabel: '确定',
cancelLabel: '取消',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom',
daysOfWeek: ['日', '一', '二', '三', '四', '五','六'],
monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
firstDay: 1,
autoApply:false,
};
$('#endDate').daterangepicker(options, function(start, end) {
console.log('New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') );
});
}
</script> </script>
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment