Showing preview only (2,047K chars total). Download the full file or copy to clipboard to get everything.
Repository: dominator88/laravel-smart
Branch: master
Commit: 023ed0967e53
Files: 352
Total size: 1.9 MB
Directory structure:
gitextract_hsg3eqim/
├── .gitattributes
├── .gitignore
├── Func.php
├── README.MD
├── composer.json
├── config/
│ └── backend.php
├── database/
│ └── migrations/
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2017_10_20_100811_create_sys_api_log_table.php
│ ├── 2017_10_20_100853_create_sys_func_table.php
│ ├── 2017_10_20_100900_create_sys_func_privilege_table.php
│ ├── 2017_10_20_100908_create_sys_mail_table.php
│ ├── 2017_10_20_100917_create_sys_merchant_table.php
│ ├── 2017_10_20_100923_create_sys_push_table.php
│ ├── 2017_10_20_100929_create_sys_role_table.php
│ ├── 2017_10_20_100940_create_sys_role_permission_table.php
│ ├── 2017_10_20_100949_create_sys_sms_table.php
│ ├── 2017_10_20_101005_create_sys_statistics_table.php
│ ├── 2017_10_20_101023_create_sys_user_group_table.php
│ ├── 2017_10_20_101030_create_sys_user_role_table.php
│ ├── 2017_10_20_101753_create_sys_app_version_table.php
│ ├── 2017_10_20_102342_create_sys_area_table.php
│ ├── 2017_10_21_024032_create_mer_album_table.php
│ ├── 2017_10_21_024040_create_mer_album_catalog_table.php
│ ├── 2017_10_21_024048_create_mer_album_tag_table.php
│ ├── 2017_10_21_024128_create_mer_goods_catalog_table.php
│ ├── 2017_10_21_024140_create_mer_sys_user_table.php
│ ├── 2017_10_25_071323_create_sys_user_table.php
│ ├── 2017_10_25_075251_create_mer_user_table.php
│ ├── 2017_11_17_034153_create_mer_user_device_table.php
│ ├── 2017_11_17_034153_create_sys_user_device_table.php
│ ├── 2017_11_20_074023_create_mer_user_address_table.php
│ ├── 2017_11_21_070513_create_mer_goods_table.php
│ ├── 2017_11_21_075633_create_mer_user_comments_table.php
│ ├── 2017_11_22_023637_create_mer_order_table.php
│ ├── 2017_11_22_031423_create_mer_articles_table.php
│ ├── 2017_11_22_031451_create_mer_articles_catalog_table.php
│ ├── 2017_11_22_031539_create_mer_ad_table.php
│ ├── 2017_11_22_031555_create_mer_ad_catalog_table.php
│ ├── 2017_11_23_015844_create_mer_goods_profile_table.php
│ ├── 2017_11_23_024951_create_mer_goods_icon_table.php
│ ├── 2017_11_23_051615_create_mer_order_items_table.php
│ ├── 2018_06_13_070749_create_sys_modules_table.php
│ └── 2018_06_23_095013_create_sys_settings_table.php
├── phpunit.xml.dist
├── resources/
│ ├── Api/
│ │ ├── Index.php
│ │ ├── Service/
│ │ │ ├── ApiService.php
│ │ │ └── v1/
│ │ │ ├── system/
│ │ │ │ └── AreaService.php
│ │ │ └── test/
│ │ │ └── LoginService.php
│ │ └── routes.php
│ ├── Models/
│ │ ├── MerAlbum.php
│ │ ├── MerAlbumTag.php
│ │ ├── MerArticles.php
│ │ ├── MerGoodsCatalog.php
│ │ ├── SysUser.php
│ │ └── User.php
│ ├── Service/
│ │ └── MerTokenService.php
│ ├── assets/
│ │ └── static/
│ │ ├── .gitignore
│ │ ├── js/
│ │ │ ├── backend/
│ │ │ │ ├── Generate.js
│ │ │ │ ├── Index.js
│ │ │ │ ├── MerAd.js
│ │ │ │ ├── MerEvent.js
│ │ │ │ ├── MerFunc.js
│ │ │ │ ├── MerGoodsCatalog.js
│ │ │ │ ├── MerRole.js
│ │ │ │ ├── MerSysUser.js
│ │ │ │ ├── MerUser.js
│ │ │ │ ├── MerUserFavorites.js
│ │ │ │ ├── Simulator.js
│ │ │ │ ├── SimulatorReadme.js
│ │ │ │ ├── SysApiLog.js
│ │ │ │ ├── SysAppVersion.js
│ │ │ │ ├── SysArea.js
│ │ │ │ ├── SysFunc.js
│ │ │ │ ├── SysMail.js
│ │ │ │ ├── SysMerchant.js
│ │ │ │ ├── SysMerchantDetail.js
│ │ │ │ ├── SysPush.js
│ │ │ │ ├── SysRole.js
│ │ │ │ ├── SysSms.js
│ │ │ │ └── SysUser.js
│ │ │ ├── global/
│ │ │ │ ├── app.js
│ │ │ │ ├── auth.js
│ │ │ │ └── layout.js
│ │ │ ├── index/
│ │ │ │ ├── Articles.js
│ │ │ │ ├── Auth.js
│ │ │ │ ├── Index.js
│ │ │ │ ├── Questions.js
│ │ │ │ ├── QuestionsCreate.js
│ │ │ │ └── Users.js
│ │ │ └── mp/
│ │ │ ├── Index.js
│ │ │ ├── MerAd.js
│ │ │ ├── MerAdCatalog.js
│ │ │ ├── MerArticles.js
│ │ │ ├── MerArticlesCatalog.js
│ │ │ ├── MerGoods.js
│ │ │ ├── MerGoodsCatalog.js
│ │ │ ├── MerOrder.js
│ │ │ └── MerUser.js
│ │ ├── plugins/
│ │ │ ├── dmg-ui/
│ │ │ │ ├── AreaSelection.js
│ │ │ │ ├── TableGrid.js
│ │ │ │ ├── TreeGrid.js
│ │ │ │ ├── Uploader.js
│ │ │ │ ├── album.js
│ │ │ │ ├── auto_fill.js
│ │ │ │ └── tiles.js
│ │ │ └── jquery-md5/
│ │ │ └── jQuery.md5.js
│ │ ├── src/
│ │ │ ├── js/
│ │ │ │ └── global/
│ │ │ │ ├── app.js
│ │ │ │ ├── custom.js
│ │ │ │ ├── format.js
│ │ │ │ └── layout.js
│ │ │ └── themes/
│ │ │ └── global/
│ │ │ ├── components-rounded.css
│ │ │ ├── custom.css
│ │ │ ├── darkblue.css
│ │ │ ├── error.css
│ │ │ ├── img/
│ │ │ │ └── flags/
│ │ │ │ └── readme.txt
│ │ │ ├── layout.css
│ │ │ └── plugins.css
│ │ └── themes/
│ │ ├── global/
│ │ │ └── login.css
│ │ └── index/
│ │ ├── app.css
│ │ └── articles.css
│ ├── npm/
│ │ └── package.json
│ └── views/
│ ├── auth/
│ │ ├── login.blade.php
│ │ ├── passwords/
│ │ │ ├── email.blade.php
│ │ │ └── reset.blade.php
│ │ └── register.blade.php
│ ├── generate/
│ │ └── index.blade.php
│ ├── home.blade.php
│ ├── index/
│ │ └── index.blade.php
│ ├── layouts/
│ │ └── app.blade.php
│ ├── meralbum/
│ │ └── index.blade.php
│ ├── meralbumcatalog/
│ │ └── index.blade.php
│ ├── merfunc/
│ │ └── index.blade.php
│ ├── mergoodscatalog/
│ │ └── index.blade.php
│ ├── merrole/
│ │ ├── index.blade.php
│ │ └── permission.blade.php
│ ├── mersysuser/
│ │ └── index.blade.php
│ ├── meruser/
│ │ └── index.blade.php
│ ├── modulefunc/
│ │ └── index.blade.php
│ ├── modulerole/
│ │ ├── index.blade.php
│ │ └── permission.blade.php
│ ├── public/
│ │ ├── footer.blade.php
│ │ ├── header.blade.php
│ │ ├── layout.blade.php
│ │ ├── layout1.blade.php
│ │ └── sidebar_menu.blade.php
│ ├── simulator/
│ │ ├── index.blade.php
│ │ └── params.blade.php
│ ├── sysapilog/
│ │ └── index.blade.php
│ ├── sysappversion/
│ │ └── index.blade.php
│ ├── sysarea/
│ │ └── index.blade.php
│ ├── sysfunc/
│ │ └── index.blade.php
│ ├── sysmail/
│ │ └── index.blade.php
│ ├── sysmerchant/
│ │ ├── detail.blade.php
│ │ └── index.blade.php
│ ├── sysmodules/
│ │ ├── index.blade.php
│ │ └── role.blade.php
│ ├── syspush/
│ │ └── index.blade.php
│ ├── sysrole/
│ │ ├── index.blade.php
│ │ └── permission.blade.php
│ ├── syssettings/
│ │ ├── index.blade.php
│ │ └── sms.blade.php
│ ├── syssms/
│ │ └── index.blade.php
│ ├── sysuser/
│ │ └── index.blade.php
│ ├── welcome.blade.php
│ └── widget/
│ ├── Checkbox.blade.php
│ ├── File.blade.php
│ ├── Hidden.blade.php
│ ├── Image.blade.php
│ ├── Radio.blade.php
│ ├── Text.blade.php
│ └── Textarea.blade.php
├── router/
│ └── routes.php
├── src/
│ ├── Auth/
│ │ └── Database/
│ │ └── seeds/
│ │ └── AdminTableSeeder.php
│ ├── Console/
│ │ ├── InstallCommand.php
│ │ └── UninstallCommand.php
│ ├── Controllers/
│ │ ├── Backend/
│ │ │ ├── AuthController.php
│ │ │ ├── Backend.php
│ │ │ ├── Generate.php
│ │ │ ├── Index.php
│ │ │ ├── MerAlbum.php
│ │ │ ├── MerAlbumCatalog.php
│ │ │ ├── MerAlbumTag.php
│ │ │ ├── MerFunc.php
│ │ │ ├── MerGoodsCatalog.php
│ │ │ ├── MerRole.php
│ │ │ ├── MerSysUser.php
│ │ │ ├── MerUser.php
│ │ │ ├── ModuleFunc.php
│ │ │ ├── ModuleRole.php
│ │ │ ├── Simulator.php
│ │ │ ├── SysApiLog.php
│ │ │ ├── SysAppVersion.php
│ │ │ ├── SysArea.php
│ │ │ ├── SysBase.php
│ │ │ ├── SysFunc.php
│ │ │ ├── SysMail.php
│ │ │ ├── SysMerchant.php
│ │ │ ├── SysModule.php
│ │ │ ├── SysPush.php
│ │ │ ├── SysRole.php
│ │ │ ├── SysSettings.php
│ │ │ ├── SysSms.php
│ │ │ └── SysUser.php
│ │ └── Controller.php
│ ├── Extensions/
│ │ └── EloquentUserProvider.php
│ ├── Interfaces/
│ │ └── TokenService.php
│ ├── Lib/
│ │ └── Discover.php
│ ├── Middleware/
│ │ ├── CheckToken.php
│ │ ├── Cors.php
│ │ ├── Permission.php
│ │ └── ResetPassword.php
│ ├── Models/
│ │ ├── MerAlbum.php
│ │ ├── MerAlbumCatalog.php
│ │ ├── MerAlbumTag.php
│ │ ├── MerGoodsCatalog.php
│ │ ├── MerSysUser.php
│ │ ├── MerUser.php
│ │ ├── MerUserDevice.php
│ │ ├── SysApiLog.php
│ │ ├── SysAppVersion.php
│ │ ├── SysArea.php
│ │ ├── SysFunc.php
│ │ ├── SysFuncPrivilege.php
│ │ ├── SysMail.php
│ │ ├── SysMerchant.php
│ │ ├── SysModule.php
│ │ ├── SysPush.php
│ │ ├── SysRole.php
│ │ ├── SysRolePermission.php
│ │ ├── SysSettings.php
│ │ ├── SysSms.php
│ │ ├── SysStatistics.php
│ │ ├── SysUser.php
│ │ ├── SysUserDevice.php
│ │ ├── SysUserRole.php
│ │ └── User.php
│ ├── Service/
│ │ ├── BaseService.php
│ │ ├── GenerateService.php
│ │ ├── MerAlbumCatalogService.php
│ │ ├── MerAlbumService.php
│ │ ├── MerAlbumTagService.php
│ │ ├── MerGoodsCatalogService.php
│ │ ├── MerSysUserService.php
│ │ ├── MerUserService.php
│ │ ├── ServiceManager.php
│ │ ├── SimulatorService.php
│ │ ├── SysApiLogService.php
│ │ ├── SysAppVersionService.php
│ │ ├── SysAreaService.php
│ │ ├── SysFuncPrivilegeService.php
│ │ ├── SysFuncService.php
│ │ ├── SysMailService.php
│ │ ├── SysMerchantService.php
│ │ ├── SysModulesService.php
│ │ ├── SysPushService.php
│ │ ├── SysRolePermissionService.php
│ │ ├── SysRoleService.php
│ │ ├── SysSettingsService.php
│ │ ├── SysSmsService.php
│ │ ├── SysUserDeviceService.php
│ │ ├── SysUserRoleService.php
│ │ ├── SysUserService.php
│ │ ├── UploadManager.php
│ │ ├── UploadService.php
│ │ ├── WidgetService.php
│ │ └── widget/
│ │ ├── RadioWidget.php
│ │ └── TextWidget.php
│ ├── SmartServiceProvider.php
│ └── Traits/
│ ├── api/
│ │ └── Service.php
│ └── service/
│ ├── GridTable.php
│ ├── Instance.php
│ ├── Scope.php
│ ├── ScopeMer.php
│ └── TreeTable.php
├── templates/
│ ├── generate/
│ │ ├── api/
│ │ │ ├── api.txt
│ │ │ ├── auth_user.txt
│ │ │ └── params/
│ │ │ ├── api_token.txt
│ │ │ ├── goodsId.txt
│ │ │ ├── merId.txt
│ │ │ ├── orderId.txt
│ │ │ ├── page.txt
│ │ │ ├── pageSize.txt
│ │ │ ├── phone.txt
│ │ │ └── status.txt
│ │ └── system/
│ │ ├── component/
│ │ │ ├── editor/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── editor_decode.txt
│ │ │ │ │ ├── editor_js.txt
│ │ │ │ │ └── editor_uri.txt
│ │ │ │ └── js/
│ │ │ │ ├── editor_clear.txt
│ │ │ │ ├── editor_init.txt
│ │ │ │ ├── editor_reload.txt
│ │ │ │ └── editor_upload_uri.txt
│ │ │ ├── field/
│ │ │ │ └── view/
│ │ │ │ ├── editor.txt
│ │ │ │ ├── input.txt
│ │ │ │ ├── radio.txt
│ │ │ │ ├── select.txt
│ │ │ │ ├── select2.txt
│ │ │ │ └── upload.txt
│ │ │ ├── select2/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── select2_css.txt
│ │ │ │ │ ├── select2_js.txt
│ │ │ │ │ └── select2_uri.txt
│ │ │ │ └── js/
│ │ │ │ ├── select2_clear.txt
│ │ │ │ ├── select2_init.txt
│ │ │ │ └── select2_set.txt
│ │ │ ├── table_type/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── grid_js.txt
│ │ │ │ │ ├── grid_read.txt
│ │ │ │ │ ├── tree_grid_js.txt
│ │ │ │ │ └── tree_grid_read.txt
│ │ │ │ ├── js/
│ │ │ │ │ ├── grid_id.txt
│ │ │ │ │ ├── grid_init.txt
│ │ │ │ │ ├── grid_plugin.txt
│ │ │ │ │ ├── tree_grid_id.txt
│ │ │ │ │ ├── tree_grid_init.txt
│ │ │ │ │ └── tree_grid_plugin.txt
│ │ │ │ ├── service/
│ │ │ │ │ ├── grid.txt
│ │ │ │ │ ├── grid_trait.txt
│ │ │ │ │ ├── tree_grid.txt
│ │ │ │ │ └── tree_grid_trait.txt
│ │ │ │ └── view/
│ │ │ │ ├── grid.txt
│ │ │ │ └── tree_grid.txt
│ │ │ ├── traits/
│ │ │ │ └── instance_trait.txt
│ │ │ ├── upload/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── upload_js.txt
│ │ │ │ │ ├── upload_param.txt
│ │ │ │ │ └── upload_uri.txt
│ │ │ │ └── js/
│ │ │ │ ├── upload_button.txt
│ │ │ │ ├── upload_preview_clear.txt
│ │ │ │ └── upload_preview_set.txt
│ │ │ └── view_type/
│ │ │ ├── js/
│ │ │ │ ├── modal.txt
│ │ │ │ └── portlet.txt
│ │ │ └── view/
│ │ │ ├── modal.txt
│ │ │ └── portlet.txt
│ │ ├── controller.txt
│ │ ├── js.txt
│ │ ├── model.txt
│ │ ├── service.txt
│ │ └── view.txt
│ └── module/
│ ├── config.txt
│ ├── controllers/
│ │ ├── index.txt
│ │ └── module.txt
│ ├── providers/
│ │ └── mainproviders.txt
│ ├── routes.txt
│ └── views/
│ └── Index/
│ └── index.txt
└── tests/
├── CreatesApplication.php
├── IndexTest.php
├── Simulator.php
├── SysFuncTest.php
├── SysUserTest.php
├── TestCase.php
├── config/
│ ├── backend.php
│ └── filesystems.php
├── factories/
│ └── factory.php
└── router/
└── routes.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
*.js linguist-language=PHP
*.css linguist-language=PHP
*.html linguist-language=PHP
================================================
FILE: .gitignore
================================================
/vendor/
composer.lock
================================================
FILE: Func.php
================================================
<?php
if (!function_exists('full_uri')) {
function full_uri($uri, $param = []) {
return url(strtolower($uri), $param);
}
}
if (!function_exists('extend')) {
/**
* 扩展数组
*
* @param $config
* @param $default
*
* @return mixed
*/
function extend($default, $config) {
foreach ($default as $key => $val) {
if (!isset($config[$key]) || $config[$key] === '') {
$config[$key] = $val;
} else if (is_array($config[$key])) {
$config[$key] = extend($val, $config[$key]);
}
}
return $config;
}
}
if (!function_exists('form_radios')) {
/**
* 水平radio 改良
*
* @param $name
* @param $data
* @param int $checked_value
*
* @return mixed|string
*/
function form_radios($name, $data, $checked_value = 0) {
$html = [];
$i = 0;
foreach ($data as $key => $val) {
if($val == (string)$checked_value || ($checked_value==0 && $i++ == 0)){
$html[] = '<label class="radio-inline"><input name="' . $name . '" type="radio" value="' . $key . '" checked>' . $val . '</label>';
}else{
$html[] = '<label class="radio-inline"><input name="' . $name . '" type="radio" value="' . $key . '" >' . $val . '</label>';
}
}
return join('',$html);
}
}
if (!function_exists('form_radio_rows')) {
/**
* 水平radio 改良
*
* @param $name
* @param $data
* @param int $checked_value
*
* @return mixed|string
*/
function form_radio_rows($name, $data, $key = 'id', $val = 'name', $checked_value = 0) {
$html = [];
foreach ($data as $item) {
if($val == (string)$checked_value ){
$html[] = '<label class="radio-inline"><input name="' . $name . '" type="radio" value="' . $item[$key] . '" checked>' . $item[$val] . '</label>';
}else{
$html[] = '<label class="radio-inline"><input name="' . $name . '" type="radio" value="' . $item[$key] . '" >' . $item[$val] . '</label>';
}
}
return join('',$html);
}
}
if (!function_exists('form_radio')) {
function form_radio($name, $data, $checked_value = 0, $title) {
$data = [
'type' => 'radio',
'title' => $title,
'name' => $name,
'data' => $data,
'value' => $checked_value,
];
return form_field($data);
}
}
if (!function_exists('form_text2')) {
function form_text2($name, $value = 0, $title, $help = '', $placeholder = '') {
$data = [
'type' => 'text',
'title' => $title,
'name' => $name,
'data' => $data,
'value' => $value,
'help' => $help,
'placeholder' => $placeholder,
];
return form_field($data);
}
}
//use Facades\Smart\Service\WidgetService;
function form_field($param) {
$widgetService = Facades\Smart\Service\WidgetService::make($param);
return $widgetService;
}
if (!function_exists("ajax_arr")) {
/**
* 生成需要返回 ajax 数组
*
* @param $msg //消息
* @param int $code //0 正常 , > 0 错误
* @param array $data //需要传递的参数
*
* @return array
*/
function ajax_arr($msg, $code = 500, $data = []) {
$arr = [
'msg' => $msg,
'code' => $code,
];
if ($data !== '') {
$arr['data'] = $data;
}
return $arr;
}
}
if (!function_exists('form_options')) {
/**
* 生成下拉选项
*
* @param $data
* @param int $selected_value
*
* @return mixed|string
*/
function form_options($data, $selected_value = -1) {
$html = '';
foreach ($data as $key => $val) {
$html .= "<option value='$key'>$val</option>";
}
if ($selected_value >= 0) {
$html = str_replace("value='$selected_value'", "value='$selected_value' selected", $html);
}
return $html;
}
}
if (!function_exists('form_checkbox_rows')) {
/**
* checkbox
*
* @param $name
* @param $data
* @param string $key
* @param string $val
* @param int $checked_value
*
* @return mixed|string
*/
function form_checkbox_rows($name, $data, $key = 'id', $val = 'name', $checked_value = 0) {
$html = '';
foreach ($data as $item) {
$html .= '<label class="checkbox-inline"><input name="' . $name . '[]" type="checkbox" value="' . $item[$key] . '" >' .
$item[$val] . '</label>';
}
if ($checked_value >= 0) {
$html = str_replace('value="' . $checked_value . '"', "value='$checked_value' checked", $html);
}
return $html;
}
}
if (!function_exists('str2pwd')) {
/**
* 字符串加密
*
* @param $str
*
* @return bool|string
*/
function str2pwd($str) {
return password_hash($str, PASSWORD_BCRYPT, ["cost" => 10]);
}
}
if (!function_exists('json')) {
function json(Array $array) {
return response()->json($array);
}
}
if (!function_exists('api_result')) {
function api_result($msg, $code_or_data = 500, $data = []) {
$result = [
'msg' => $msg,
];
if (is_array($code_or_data)) {
$result['code'] = 0;
$data = array_merge($code_or_data, $data);
} else {
$result['code'] = $code_or_data;
}
if (!empty($data)) {
$result['data'] = $data;
}
return $result;
}
}
if (!function_exists('rand_string')) {
/**
* 生成随机字符串
*
* @param $length
*
* @return string
*/
function rand_string($length = 6) {
$str = NULL;
$strPol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
$max = strlen($strPol) - 1;
for ($i = 0; $i < $length; $i++) {
$str .= $strPol[rand(0, $max)]; // rand($min,$max)生成介于min和max两个数之间的一个随机整数
}
return $str;
}
}
if (!function_exists('form_options_rows')) {
/**
* 生成下拉选项 from rows
*
* @param $data
* @param string $id
* @param string $text
* @param string $node_field
* @param int $selected_value
* @param array $dat
*
* @return mixed|string
*/
function form_options_rows($data, $id = 'id', $text = "name", $node_field = "children", $selected_value = 0, $dat = []) {
$html = '';
foreach ($data as $row) {
$value = $row->$id;
$prefix = '';
if (isset($row->level)) {
$prefix = $row->level - 1 > 0 ? str_repeat(' ', $row->level - 1) . '└─ ' : ''; // ┗
}
$title = $prefix . $row->$text;
$d = '';
foreach ($dat as $p) {
$d .= sprintf(' data-%s="%s"', $p, $row[$p]);
}
$html .= sprintf('<option value="%s" %s>%s</option>', $value, $d, $title);
if (isset($row->$node_field)) {
$html .= form_options_rows($row[$node_field], $id, $text, 0, $row->level + 1);
}
}
if (!empty($selected_value)) {
$html = str_replace('value="' . $selected_value . '"', 'value="' . $selected_value . '" selected', $html);
}
return $html;
}
}
if (!function_exists('form_options_rows_group')) {
/**
* optgroup 显示 options
*
* @param $data
* @param $valueField
* @param $textField
* @param $groupField
*
* @return string
*/
function form_options_rows_group($data, $valueField = 'id', $textField = 'text', $groupField = 'type_text') {
$newData = [];
foreach ($data as $item) {
if (array_key_exists($groupField, $item)) {
$newData[$item[$groupField]][] = $item;
}
}
$html = '';
foreach ($newData as $key => $row) {
$html .= '<optgroup label="' . $key . '">';
foreach ($row as $r) {
$html .= '<option value="' . $r[$valueField] . '">' . $r[$textField] . '</option> ';
}
$html .= '</optgroup> ';
}
return $html;
}
}
if (!function_exists('file_size')) {
function file_size($size) {
$unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
$index = 0;
do {
$size = $size / 1024;
$index++;
} while ($size >= 1024);
return round($size, 1) . $unit[$index];
}
}
if (!function_exists('full_img_uri')) {
/**
* 返回图片绝对路径
*
* @param $imgUri
*
* @return string
*/
function full_img_uri($imgUri) {
if (config('backend.image.uploadType') == 'local') {
return route($imgUri, '', '', TRUE);
}
return config('backend.image.imgUri') . $imgUri;
}
}
if (!function_exists('css')) {
/**
* 返回图片绝对路径
*
* @param $imgUri
*
* @return string
*/
function css() {
if(class_exists(Mp\Service\Common\Asset::class)){
return Mp\Service\Common\Asset::css();
}
}
}
if (!function_exists('js')) {
/**
* 返回图片绝对路径
*
* @param $imgUri
*
* @return string
*/
function js() {
if(class_exists(Mp\Service\Common\Asset::class)){
return Mp\Service\Common\Asset::js();
}
}
}
if (!function_exists('script')) {
/**
* 返回图片绝对路径
*
* @param $imgUri
*
* @return string
*/
function script() {
if(class_exists(Mp\Service\Common\Asset::class)){
return Mp\Service\Common\Asset::script();
}
}
}
if(!function_exists('human_filesize')){
/**
* 返回可读性更好的文件尺寸
*/
function human_filesize($bytes, $decimals = 2)
{
$size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB'];
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) .@$size[$factor];
}
}
if(!function_exists('is_image')){
/**
* 判断文件的MIME类型是否为图片
*/
function is_image($mimeType)
{
return starts_with($mimeType, 'image/');
}
}
================================================
FILE: README.MD
================================================
laravel-smart
---------
- 项目的路由,视图文件均在扩展包内,默认的后台请不要作改动啦,项目主要的优势在于API接口的开发,自动生成标准的API文件格式
- 普通web应用也能做,如果需要添加额外的路由,请直接在根目录下的 `routes/web.php` `routes/api.php` 里进行添加.
- 本项目的初衷是制作一个纯粹的扩展包,能安装即用,卸载即清.
- 演示站点正在搭建中, 手册什么的也在计划编写,请关注本项目,以便了解项目的最新动态.
大家可以积极提交 ISSUE
- 为方便大家交流,以及项目代码bug反馈,大家可以添加QQ群 : _195857398_
- [演示地址](http://112.124.44.7/backend/index/index)
> 帐户 admin@admin.com 密码 123123
**简介**
--------
- 基于 laravel 5.5
- 系统管理平台
- 商户管理平台
- RBAC 用户权限管理
- RESTful 接口
- 微信接口
安装步骤
--------
- 设置composer.json,找到config元素配置地方更改为如下
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},"minimum-stability": "dev",
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
- 首先安装好laravel,并且设置好数据库连接
`composer require dominator88/laravel-smart:dev-master`
- 运行下面命令来发布资源,以及安装数据库
`php artisan vendor:publish --provider="Smart\SmartServiceProvider"`
`php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="migrations"`
`php artisan make:auth`
配置 config/backend.php,这里可以设置初始化超级管理员帐户,也可使用默认默认(不作 修改),在后面会提到默认配置的帐户名密码
`php artisan smart:install`
为权限认证添加 模块,并设置为当前认证模型, 更改 confit/auth.php 文件
<?php
return [
'defaults' => [
'guard' => 'admin',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\Models\User::class,
],
'admin' => [
'driver' => 'eloquent',
'model' => Smart\Models\SysUser::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
],
],
];
### 图片上传设置
图片上传设置,需要运行如下命令,为图片的路径建立软链接,如果安装环境为docker,需要自行进入项目目录bash,将软链接设置正确
php artisan storage:link
### 如此便可以进行访问:
>后台地址: http:// sitename /backend/index/index
>帐户名: sys_admin
>密码: 123123
>邮箱:admin@admin.com
从项目根目录进入 public 目录,执行命令:
`npm update`
在此请注意 需要将 config/backend.php 里 baseUri 更改为当前域名 , 否则页面会出现样式错乱
不知道 npm 如何安装的可以在搜索引擎上查找。
创建模块
`php artisan smart:install 模块名`
> 创建模块后,需要在 **.env** 文件中将模块加入到 *MODULE_EXT* 配置中,以逗号分隔
执行上面命令后,会在app目录下生成对应模块
### 接口说明
--------
> 接口uri
> <https:// sitename /api>
> 接口密钥
> smart2_api_secret
#### header
| 名称 | 说明 | 描述 |
| ------------------ |:----------------:| ----------------------------:|
| device | 客户端系统类型 | Apple iphone 7 |
| device-os-version | 客户端系统版本号 | 如: 10.0.2 |
| timestamp | 时间戳 | 如: 1476340001 |
| signature | 签名 | 如: 103ed1d081... 详见签名规则 |
#### body
所有键和值全部为字符串
{
key1 : val1 ,
key2 : val2,
key2 : "[{k1 : v1} , { k2 : v2 }]" //用json字符串传输 数组
...
}
#### 返回结果
- 单行数据
{
code : 0 // 0 表示成功 , 403 表示需要登录 , 其余为其他错误
msg : "文字信息" ,
data : {
key1 : val1,
key2 : val2,
...
}
}
- 多行数据
{
code : 0
msg : "文字信息" ,
data : {
rows : [
{
key01 : val01,
key02 : val02,
...
},
{
key11 : val11,
key12 : val12,
...
},
...
]
},
key : value
}
#### 签名规则
- 假设 要发送的数据 meta 为:
var meta = {
token : "103ed1d0811212312" ,
merId : "1",
}
签名密钥为 : smart_api_secret
- 将 timestamp 加入meta数据中 , 如
var signatureMeta = {
token : "103ed1d0811212312" ,
merId : "1",
timestamp : 1476340001
}
- signatureMeta 按key的字符正序排列 ,并转为 key1=val1&key2=val2... 类型的字符串,如:
var signatureString = merId=1×tamp=1476340001&token=103ed1d0811212312
- 在字符串后加上签名密钥 ,如: "&secret=签名密钥"
var signatureString = merId=1×tamp=1476340001&token=103ed1d0811212312&secret=smart2_api_secret
- md5 signatureString 得到签名
================================================
FILE: composer.json
================================================
{
"name": "dominator88/laravel-smart",
"description": "后台管理系统.能快速度进行移动端开发.集成多个常见工具包.",
"keywords": ["admin", "laravel", "grid", "api"],
"homepage": "https://github.com/dominator88/laravel-smart",
"license": "MIT",
"authors": [{
"name": "mr.z",
"email": "zsh2088@gmail.com"
}],
"type": "library",
"require": {
"php": ">=7.0.0",
"laravel/framework": "5.5.*",
"cebe/markdown": "^1.1",
"jpush/jpush": "^3.5",
"laravel/tinker": "~1.0",
"guzzlehttp/guzzle": "^6.2@dev",
"toplan/laravel-sms": "~2.6",
"intervention/image": "^2.3@dev",
"laravel/dusk": "^2.0@dev",
"overtrue/easy-sms": "1.1.*",
"prettus/l5-repository": "^2.6",
"spatie/laravel-permission": "^2.36"
},
"require-dev": {
"phpunit/phpunit": "~6.0"
},
"minimum-stability": "dev",
"autoload": {
"classmap": [
"tests/factories"
],
"psr-4": {
"Smart\\": "src/"
},
"files": [
"Func.php"
]
},
"autoload-dev": {
"psr-4": {
},
"classmap": [
"tests/TestCase.php"
]
},
"extra": {
"laravel": {
"providers": [
"Smart\\SmartServiceProvider",
"Intervention\\Image\\ImageServiceProvider"
],
"aliases": {
"Image": "Intervention\\Image\\Facades\\Image"
}
}
}
}
================================================
FILE: config/backend.php
================================================
<?php
/**
* Created by PhpStorm.
* User: sl
* Date: 2017/9/14
* Time: 11:07
*/
return [
'version' => '2.0',
'baseUri' => '/',
/*
|--------------------------------------------------------------------------
| Access via `https`
|--------------------------------------------------------------------------
|
| 后台是否使用https
|
*/
'https' => env('BACKEND_HTTPS',false),
'projectName' => 'laravel-smart',
'sessionName' => 'backend_session',
'directory' => ['Api' , 'backend' , 'mp' , 'Service' , 'Models'],
'superAdminId' => 1,
'defaultAdmin' => 'sys_admin',
'defaultPwd' => '123123',
'defaultEmail' => 'admin@admin.com',
'areaCachePrefix' => 'backend_area',
'secret' => 'laravel-smart-secret',
'timeGap' => 300,
'JPush' => [
'appKey' => 'xxx' ,
'secret' => 'xxx' ,
] ,
'image' => [
'imgUri' => '',
'uploadType' => 'local',
],
'sms' => [
'name' => 'alidayu',
],
'api' => [
'apiVersion' => 'v1',
],
//自定义扩展模块 默认模块为backend mp为自定义需要自行在app目录下创建mp文件夹 执行安装时自动生成目录及路由文件
'module_ext' => env('MODULE_EXT' , 'mp'),
];
================================================
FILE: database/migrations/2014_10_12_000000_create_users_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
================================================
FILE: database/migrations/2014_10_12_100000_create_password_resets_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}
================================================
FILE: database/migrations/2017_10_20_100811_create_sys_api_log_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysApiLogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_api_log', function (Blueprint $table) {
$table->increments('id');
$table->string('device')->nullable();
$table->string('device_os_version')->nullable();
$table->string('app_version')->nullable();
$table->string('api_version')->nullable();
$table->string('uri')->nullable();
$table->string('ip')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_api_log');
}
}
================================================
FILE: database/migrations/2017_10_20_100853_create_sys_func_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysFuncTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_func', function (Blueprint $table) {
$table->increments('id');
$table->integer('pid')->default(0);
$table->tinyInteger('sort')->default(1);
$table->string('module',40);
$table->tinyInteger('is_menu')->default(0);
$table->tinyInteger('is_func')->default(0);
$table->string('color')->nullable();
$table->string('name');
$table->string('icon')->nullable();
$table->string('uri')->nullable();
$table->string('desc')->nullable();
$table->tinyInteger('status')->default(1);
$table->integer('level')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_func');
}
}
================================================
FILE: database/migrations/2017_10_20_100900_create_sys_func_privilege_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysFuncPrivilegeTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_func_privilege', function (Blueprint $table) {
$table->increments('id');
$table->integer('func_id');
$table->enum('name' , ['read' , 'create' , 'update' , 'delete']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_func_privilege');
}
}
================================================
FILE: database/migrations/2017_10_20_100908_create_sys_mail_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysMailTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_mail', function (Blueprint $table) {
$table->increments('id');
$table->enum('type' , ['captcha' , 'reset_pwd']);
$table->string('name');
$table->string('address');
$table->string('subject');
$table->text('content');
$table->string('captcha' , 10);
$table->tinyInteger('status' )->default(1);
$table->dateTime('sent_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_mail');
}
}
================================================
FILE: database/migrations/2017_10_20_100917_create_sys_merchant_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysMerchantTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_merchant', function (Blueprint $table) {
$table->increments('id');
$table->integer('sort');
$table->string('name');
$table->string('icon')->nullable();
$table->string('phone' , 20);
$table->string('contact',30)->nullable();
$table->string('email',200)->nullable();
$table->string('id_card')->nullable();
$table->tinyInteger('status')->default(1);
$table->integer('area')->nullable();
$table->string('address',200)->nullable();
$table->decimal('settled_amount' , 10,2)->nullable();
$table->decimal('balance' , 10 ,2)->nullable();
$table->decimal('withdraw_amount' , 10,2)->nullable();
$table->integer('apply_user_id' )->nullable();
$table->tinyInteger('for_test')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_merchant');
}
}
================================================
FILE: database/migrations/2017_10_20_100923_create_sys_push_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysPushTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_push', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id');
$table->enum('catalog' , ['alert' , 'order' , 'event']);
$table->string('title');
$table->string('alert');
$table->enum('platform' , ['all' , 'ios' , 'android']);
$table->string('alias');
$table->string('tags');
$table->string('registration_id', 40);
$table->string('extras');
$table->tinyInteger('status');
$table->dateTime('sent_at');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_push');
}
}
================================================
FILE: database/migrations/2017_10_20_100929_create_sys_role_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysRoleTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_role', function (Blueprint $table) {
$table->increments('id');
$table->tinyInteger('sort')->default(0);
$table->string('module' )->default('backend')->comment('模块');
$table->integer('mer_id')->default(0);
$table->string('name');
$table->tinyInteger('status');
$table->string('desc')->nullable();
$table->tinyInteger('rank')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_role');
}
}
================================================
FILE: database/migrations/2017_10_20_100940_create_sys_role_permission_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysRolePermissionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_role_permission', function (Blueprint $table) {
$table->increments('id');
$table->integer('role_id');
$table->integer('privilege_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_role_permission');
}
}
================================================
FILE: database/migrations/2017_10_20_100949_create_sys_sms_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysSmsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_sms', function (Blueprint $table) {
$table->increments('id');
$table->enum('type' , ['captcha']);
$table->string('phone');
$table->string('content');
$table->integer('temp_id');
$table->dateTime('sent_at')->nullable();
$table->dateTime('verified_at')->nullable();
$table->string('message_id' , 32)->nullable();
$table->tinyInteger('status' )->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_sms');
}
}
================================================
FILE: database/migrations/2017_10_20_101005_create_sys_statistics_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysStatisticsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_statistics', function (Blueprint $table) {
$table->increments('id');
$table->integer('users_total' );
$table->integer('users_today' );
$table->integer('api' );
$table->integer('articles_total' );
$table->integer('articles_today' );
$table->integer('videos_total' );
$table->integer('videos_today' );
$table->date('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_statistics');
}
}
================================================
FILE: database/migrations/2017_10_20_101023_create_sys_user_group_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysUserGroupTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_user_group', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->integer('group_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_user_group');
}
}
================================================
FILE: database/migrations/2017_10_20_101030_create_sys_user_role_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysUserRoleTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_user_role', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->integer('role_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_user_role');
}
}
================================================
FILE: database/migrations/2017_10_20_101753_create_sys_app_version_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysAppVersionTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_app_version', function (Blueprint $table) {
$table->increments('id');
$table->enum('device' ,['ios' , 'android']);
$table->string('version' ,30);
$table->string('uri' , 200);
$table->string('description' , 2000);
$table->tinyInteger('is_force' );
$table->enum('environment' , ['production' , 'test' , 'debug']);
$table->tinyInteger('status' );
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_app_version');
}
}
================================================
FILE: database/migrations/2017_10_20_102342_create_sys_area_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSysAreaTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sys_area', function (Blueprint $table) {
$table->increments('id');
$table->integer('level');
$table->integer('pid' );
$table->string('text');
$table->string('tip');
$table->tinyInteger('status');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sys_area');
}
}
================================================
FILE: database/migrations/2017_10_21_024032_create_mer_album_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerAlbumTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_album', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id')->default(0);
$table->integer('sort')->default(1);
$table->string('uri',200)->nullable();
$table->integer('size')->default(0);
$table->string('mimes', 50)->nullable();
$table->string('img_size', 200)->default(0);
$table->string('desc')->nullable();
$table->tinyInteger('status')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_album');
}
}
================================================
FILE: database/migrations/2017_10_21_024040_create_mer_album_catalog_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerAlbumCatalogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_album_catalog', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id');
$table->integer('sort');
$table->string('tag' , 200);
$table->string('icon' , 200);
$table->integer('totals' );
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_album_catalog');
}
}
================================================
FILE: database/migrations/2017_10_21_024048_create_mer_album_tag_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerAlbumTagTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_album_tag', function (Blueprint $table) {
$table->increments('id');
$table->integer('catalog_id');
$table->integer('album_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_album_tag');
}
}
================================================
FILE: database/migrations/2017_10_21_024128_create_mer_goods_catalog_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerGoodsCatalogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_goods_catalog', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id')->default(0);
$table->integer('pid')->default(0);
$table->string('text')->nullable();
$table->string('icon')->nullable();
$table->string('desc')->nullable();
$table->tinyInteger('sort')->default(1);
$table->tinyInteger('level')->default(1);
$table->tinyInteger('status')->default(1);
$table->enum('type' , ['goods' , 'virtual' , 'service'])->default('goods');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_goods_catalog');
}
}
================================================
FILE: database/migrations/2017_10_21_024140_create_mer_sys_user_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerSysUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_sys_user', function (Blueprint $table) {
/* $table->increments('id');*/
$table->integer('id');
$table->integer('mer_id');
$table->integer('sys_user_id');
$table->index('mer_id' ,'mer_id' );
$table->index('sys_user_id' , 'sys_user_id');
$table->primary(['id','mer_id', 'sys_user_id'] , 'id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_sys_user');
}
}
================================================
FILE: database/migrations/2017_10_25_071323_create_sys_user_table.php
================================================
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSysUserTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('sys_user', function (Blueprint $table) {
$table->increments('id');
$table->string('module')->default('backend');
$table->string('username');
$table->string('password');
$table->string('icon')->nullable();
$table->string('email')->nullable();
$table->string('phone')->nullable();
$table->tinyInteger('status')->default(1);
$table->string('api_token', 64)->nullable();
$table->timestamps();
$table->dateTime('signed_at')->nullable();
$table->ipAddress('signed_ip')->nullable();
$table->rememberToken()->nullable();
$table->string('name')->nullable();
$table->unique('email')->nullable();
$table->unique('username')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('sys_user');
}
}
================================================
FILE: database/migrations/2017_10_25_075251_create_mer_user_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerUserTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_user', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id')->default(0);
$table->integer('referee_id')->default(0);
$table->tinyInteger('sex');
$table->string('username');
$table->string('nickname');
$table->string('password');
$table->string('icon')->nullable();
$table->string('email')->nullable();
$table->string('truename')->nullable();
$table->string('phone');
$table->decimal('bucks')->default(0);
$table->integer('points')->default(0);
$table->tinyInteger('status')->default(1);
$table->string('industries')->nullable();
$table->enum('reg_from' , ['phone', 'qq', 'wx', 'wb', 'email', 'unknown']);
$table->string('reg_ip')->nullable();
$table->dateTime('reg_at')->nullable();
$table->string('login_ip')->nullable();
$table->dateTime('login_at')->nullable();
$table->tinyInteger('for_test')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_user');
}
}
================================================
FILE: database/migrations/2017_11_17_034153_create_mer_user_device_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerUserDeviceTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_user_device', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('token', 64)->nullable();
$table->enum('device' , ['iphone' , 'ipad' , 'android' , 'pc' , 'mac' , 'unknow'])->nullable();
$table->string('device_os_version' , 20)->nullable();
$table->string('app_version' , 20)->nullable();
$table->string('api_version' , 20)->nullable();
$table->string('registration_id' , 50)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_user_device');
}
}
================================================
FILE: database/migrations/2017_11_17_034153_create_sys_user_device_table.php
================================================
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSysUserDeviceTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('sys_user_device', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->enum('device', ['iphone', 'ipad', 'android', 'pc', 'mac', 'unknow'])->nullable();
$table->string('device_os_version', 20)->nullable();
$table->string('app_version', 20)->nullable();
$table->string('api_version', 20)->nullable();
$table->string('registration_id', 50)->nullable();
$table->tinyInteger('for_test')->default(0)->comment('是否测试账户');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('sys_user_device');
}
}
================================================
FILE: database/migrations/2017_11_20_074023_create_mer_user_address_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerUserAddressTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_user_address', function (Blueprint $table) {
$table->increments('uid');
$table->integer('user_id');
$table->string('name' , 200)->nullable();
$table->string('phone' , 20)->nullable();
$table->integer('area_id');
$table->string('address' , 500)->nullable();
$table->string('postcode' , 10)->nullable();
$table->tinyInteger('status' )->default(1);
$table->tinyInteger('is_default' )->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_user_address');
}
}
================================================
FILE: database/migrations/2017_11_21_070513_create_mer_goods_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerGoodsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_goods', function (Blueprint $table) {
$table->increments('id');
$table->integer('sys_goods_id')->nullable();
$table->integer('sys_goods_pid')->nullable();
$table->integer('mer_id')->nullable();
$table->integer('pid')->default(0);
$table->integer('sort')->default(999);
$table->string('sku' , 50)->nullable()->unique();
$table->string('name' , 200)->unique();
$table->integer('catalog_id')->default(0);
$table->text('highlight' ,400)->nullable();
$table->string('icon' ,200)->nullable();
$table->string('desc' , 200)->nullable();
$table->string('tags' , 300)->nullable();
$table->dateTime('start_time')->nullable();
$table->dateTime('end_time')->nullable();
$table->enum('currency' , ['cny' , 'points'])->default('cny');
$table->decimal('price_market',8,2)->default('0.00');
$table->decimal('price',8,2)->default('0.00');
$table->integer('points')->default(0);
$table->tinyInteger('status')->default(1);
$table->string('meta_title' , 100)->nullable();
$table->string('meta_keywords' , 1000)->nullable();
$table->string('meta_description' , 1000)->nullable();
$table->tinyInteger('recommend' )->default(0);
$table->tinyInteger('hot')->default(0);
$table->tinyInteger('cheap')->default(0);
$table->integer('sales')->default(0);
$table->integer('comments')->default(0);
$table->integer('pv')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_goods');
}
}
================================================
FILE: database/migrations/2017_11_21_075633_create_mer_user_comments_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerUserCommentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_user_comments', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->nullable();
$table->enum('type' , ['article' , 'goods' , 'event'])->default('article');
$table->integer('type_id')->comment('对象ID')->default(0);
$table->text('content')->comment('内容');
$table->text('reply')->comment('回复内容');
$table->dateTime('replied_at');
$table->tinyInteger('status')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_user_comments');
}
}
================================================
FILE: database/migrations/2017_11_22_023637_create_mer_order_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerOrderTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_order', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->integer('mer_id');
$table->enum('type' , ['goods' , 'virtual' , 'service'])->default('goods');
$table->string('order_no' , 16);
$table->integer('address_id');
$table->string('address_name' , 200);
$table->string('address_phone' , 20 );
$table->string('address' , 500);
$table->string('address_post' , 6)->nullable();
$table->integer('event_id' )->nullable();
$table->integer('event_amount' )->default(0);
$table->integer( 'coupon_id')->nullable();
$table->decimal('coupon_amount' , 8, 2)->default(0.00);
$table->decimal('bucks' , 8, 2)->default(0.00);
$table->enum('currency' , ['cny' , 'points'])->default('cny');
$table->decimal('amount' , 8,2)->default(0.00);
$table->enum('pay_channel',['alipay' , 'wx' , 'points'])->default('alipay');
$table->decimal('pay_amount' , 11,2)->default(0.00);
$table->tinyInteger('status' )->default(1);
$table->integer('get_points' )->default(0);
$table->integer('pay_id' )->nullable();
$table->string('user_mark' )->nullable();
$table->string('sys_mark' )->nullable();
$table->dateTime('pay_time');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_order');
}
}
================================================
FILE: database/migrations/2017_11_22_031423_create_mer_articles_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerArticlesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_articles', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id')->nullable();
$table->integer('catalog_id');
$table->integer('sort')->default(999);
$table->string('title' , 200);
$table->string('icon' , 200)->nullable();
$table->string('tags' , 200)->nullable();
$table->string('desc' , 200)->nullable();
$table->text('content')->nullable();
$table->tinyInteger('status')->default(1);
$table->dateTime('start_at');
$table->dateTime('end_at');
$table->integer('comments')->default(0);
$table->integer('likes')->default(0);
$table->integer('pv')->default(0);
$table->integer('favorites')->default(0);
$table->integer('userId')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_articles');
}
}
================================================
FILE: database/migrations/2017_11_22_031451_create_mer_articles_catalog_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerArticlesCatalogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_articles_catalog', function (Blueprint $table) {
$table->increments('id');
$table->integer('pid')->default(0);
$table->integer('mer_id');
$table->tinyInteger('sort')->default(99);
$table->string('text' , 200);
$table->string('icon' , 200)->nullable();
$table->string('desc' , 200)->nullable();
$table->tinyInteger('level' )->default(1);
$table->tinyInteger('status' )->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_articles_catalog');
}
}
================================================
FILE: database/migrations/2017_11_22_031539_create_mer_ad_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerAdTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_ad', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id')->nullable();
$table->string('name');
$table->tinyInteger('sort')->default(99);
$table->integer('catalog_id')->unsigned();
$table->foreign('catalog_id')->references('id')->on('sys_merchant');
$table->string('icon')->default('');
$table->string('uri')->nullable();
$table->integer('pv')->default(0);
$table->tinyInteger('status')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_ad');
}
}
================================================
FILE: database/migrations/2017_11_22_031555_create_mer_ad_catalog_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerAdCatalogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_ad_catalog', function (Blueprint $table) {
$table->increments('id');
$table->integer('mer_id')->nullable();
$table->string('text' , 200)->nullable();
$table->integer('width')->default(0);
$table->integer('height')->default(0);
$table->tinyInteger('status')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_ad_catalog');
}
}
================================================
FILE: database/migrations/2017_11_23_015844_create_mer_goods_profile_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerGoodsProfileTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_goods_profile', function (Blueprint $table) {
$table->increments('id');
$table->integer('goods_id')->unsigned();
$table->string('package')->nullable();
$table->text('content')->nullable();
$table->foreign('goods_id')->references('id')->on('mer_goods');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_goods_profile');
}
}
================================================
FILE: database/migrations/2017_11_23_024951_create_mer_goods_icon_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerGoodsIconTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_goods_icon', function (Blueprint $table) {
$table->increments('id');
$table->tinyInteger('sort')->default(99);
$table->integer('goods_id')->unsigned();
$table->string('uri' , 200)->nullable();
$table->tinyInteger('is_cover')->default(0);
$table->foreign('goods_id')->references('id')->on('mer_goods');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_goods_icon');
}
}
================================================
FILE: database/migrations/2017_11_23_051615_create_mer_order_items_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMerOrderItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('mer_order_items', function (Blueprint $table) {
$table->increments('id');
$table->integer('order_id');
$table->integer('goods_id');
$table->string('goods_name' , 200)->nullable();
$table->string('icon' , 200)->nullable();
$table->enum('currency' , ['cny' , 'points' , ])->nullable();
$table->decimal('amount' , 11,2)->default(0.00);
$table->integer('qty');
$table->integer('event_id')->nullable();
$table->integer('event_amount')->default(0);
$table->integer('coupon_id')->nullable();
$table->integer('coupon_amount')->default(0);
$table->integer('get_points')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('mer_order_items');
}
}
================================================
FILE: database/migrations/2018_06_13_070749_create_sys_modules_table.php
================================================
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSysModulesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('sys_modules', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->comment('模块名称');
$table->string('symbol')->comment('标识');
$table->tinyInteger('displayorder')->default(0)->comment('排序序号');
$table->string('version')->default('1.0')->comment('版本号');
$table->string('author')->nullable()->comment('作者');
$table->tinyInteger('status')->default(1)->comment('状态');
$table->string('thumb')->nullable()->comment('缩略图');
$table->string('desc')->nullable()->comment('描述');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('sys_modules');
}
}
================================================
FILE: database/migrations/2018_06_23_095013_create_sys_settings_table.php
================================================
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSysSettingsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('sys_settings', function (Blueprint $table) {
$table->increments('id');
$table->string('key')->default('')->comment('名称');
$table->string('value')->default('')->comment('配置值');
$table->string('group')->default('default')->comment('配置分组');
$table->string('type')->default('text')->comment('配置类型 text radio');
$table->integer('desc')->default(99)->comment('排序');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('sys_settings');
}
}
================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Smart">
<directory suffix="Test.php">./packages/laravel-smart/tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
</phpunit>
================================================
FILE: resources/Api/Index.php
================================================
<?php
/**
* Created by PhpStorm.
* User: MR.Z < zsh2088@gmail.com >
* Date: 2017/9/18
* Time: 21:07
*/
namespace App\Api;
use App\Api\Service\v1\ApiService;
use Illuminate\Http\Request;
class Index {
public $api = NULL;
public function __construct() {
$this->api = ApiService::instance();
$this->api->debug = FALSE;
}
public function index(Request $request , $version , $directory , $action = 'index' ) {
$header = [
'timestamp' => $request->header( 'timestamp' ) ,
'signature' => $request->header( 'signature' ) ,
'device' => $request->header( 'device' ) ,
'deviceOsVersion' => $request->header( 'device-os-version' ) ,
'appVersion' => $request->header( 'app-version' ) ,
'apiVersion' => $request->input('version') ,
];
//取api
$api = $this->api;
$params = $request->all();
//取时间戳
$params['timestamp'] = $request->header( 'timestamp' ) ;
$params = array_merge( $params , $header );
$result = $this->response( $version , $directory , $action , $params );
$api->log( '请求结束' );
return json( $result );
}
/**
* 响应辅助函数
*
* @param $version
* @param $directory
* @param $action
* @param $params
*
* @return array
*/
private function response( $version , $directory , $action , $params ) {
$action = ucfirst( $action );
$version = strtolower( $version );
$class = '\\App\\Api\\Service\\' . $version . '\\' . $directory . '\\' . $action . 'Service';
$this->api->log( 'service file' , $class );
//检查是否存在响应文件
if ( ! class_exists( $class ) ) {
return $this->api->getError( 404 );
}
//初始化响应类
$instance = $class::instance( $params );
//检查请求方式
if ( ! $this->checkRequestMethod( $instance->allowRequestMethod ) ) {
return $this->api->getError( 408 );
}
return $instance->response();
}
/**
* 检查 请求方式是否允许
*
* @param array $allowRequestMethod
*
* @return bool
*/
private function checkRequestMethod( $allowRequestMethod = [] ) {
$requestMethod = strtolower( request()->method() );
if ( empty( $allowRequestMethod ) ) {
return FALSE;
}
return isset( $allowRequestMethod[ $requestMethod ] );
}
}
================================================
FILE: resources/Api/Service/ApiService.php
================================================
<?php
/**
* Created by PhpStorm.
* User: MR.Z < zsh2088@gmail.com >
* Date: 2017/9/18
* Time: 21:13
*/
namespace App\Api\Service\v1;
use App\Service\SysTokenService;
use Illuminate\Auth\AuthManager;
use Illuminate\Support\Facades\Auth;
use Smart\Interfaces\TokenService;
use Smart\Service\AuthUcService;
use Smart\Service\MerUserDeviceService;
use Illuminate\Support\Facades\DB;
define( 'PARAM_REQUIRED' , 'required' );
define( 'PARAM_DIGIT' , 'digit' );
define( 'PARAM_POSITIVE' , 'positive' );
class ApiService {
use \Smart\Traits\Service\Instance;
public $debug = TRUE;
public $params = [];
public $defaultParams = [];
public $defaultResponse = [];
public $userId = '';
public $behalf = '';
public $merId = '';
public $error = '';
public $errCode = 500;
public $token = '';
//出错代码表
public $code = [
0 => 'success' ,
//客户端问题
400 => 'param error' ,
401 => 'not login' ,
403 => 'please login' ,
404 => 'operator not found' ,
405 => 'error timestamp' ,
406 => 'error signature' ,
407 => 'unknown error' ,
408 => 'no allow request method' ,
//服务端问题
500 => 'runtime error' ,
503 => 'server not found' ,
504 => 'data not found' ,
505 => 'data exist'
];
public function params($params = []){
$this->params = $params;
}
public function getError( $code ) {
return api_result( $this->code[ $code ] , $code );
}
/**
* 数据签名
*
* @param $inputArr
*
* @return string
*/
public function signature( $inputArr ) {
ksort( $inputArr );
$new_arr = [];
foreach ( $inputArr as $key => $val ) {
$val = htmlspecialchars_decode( $val );
if ( is_array( $val ) ) {
$val = json_encode( $val , JSON_UNESCAPED_UNICODE );
}
$new_arr[] = "$key=$val";
// echo "$key=$val <br/>";
}
$signature = implode( '&' , $new_arr ) . '&secret=' . config( 'backend.secret' );
$this->log( '签名:' , $inputArr );
return md5( $signature );
}
/**
* 校验签名
*
* @param $metaData
* @param $signature
*
* @return bool
*/
public function validSignature( $metaData , $signature ) {
if ( empty( $signature ) ) {
return FALSE;
}
if ( isset( $metaData['file_data'] ) ) {
unset( $metaData['file_data'] );
}
$newSignature = $this->signature( $metaData );
$this->log( 'server signature' , $newSignature );
return $signature == $newSignature;
}
/**
* 验证时间戳
*
* @param $timestamp
*
* @return bool
*/
public function validTimestamp( $timestamp ) {
$this->log( 'server time' , time() );
$this->log( 'client time' , $timestamp );
$this->log( 'time_diff' , abs( time() - $timestamp ) );
if ( empty( $timestamp ) ) {
return FALSE;
}
return abs( time() - $timestamp ) < config( 'backend.timeGap' );
}
/**
* 验证用户
*
* @return mixed
*/
public function validToken( ) {
// $this->token = resolve( TokenService::class );
$this->userId = '';
$this->error = 500;
if ( ! isset( $this->params['api_token'] ) || empty( $this->params['api_token'] ) ) {
//参数错误
$this->error = '请填写token';
return FALSE;
} else {
// $MemberData = $this->token->getByToken($this->params['token']);
$MemberData = Auth::guard('api')->user();
// AuthManager::
if ( empty( $MemberData ) ) {
//数据未找到
$this->error = '认证失败';
$this->errCode = 403;
return FALSE;
}
$this->userId = $MemberData->id;
return TRUE;
}
}
/**
* 验证单个参数
*
* @param $paramName
* @param string $rule
*
* @return bool
*/
// public function validParam( $paramName, $rule = PARAM_REQUIRED ) {
// $this->error = '';
// $this->errCode = 500;
// switch ( $rule ) {
// case PARAM_REQUIRED :
// if ( empty( trim( $this->requestParams[ $paramName ] ) ) ) {
// $this->error = "$paramName 不能为空";
//
// return FALSE;
// }
// }
//
// return TRUE;
// }
/**
* 验证全部参数
*
* @return bool
*/
public function validParams() {
$method = strtolower( request()->method() );
foreach ( $this->defaultParams[ $method ] as $key => $defined ) {
//如果是非必填参数 则赋值为 默认值,以避免程序错误
if ( ! isset( $defined[2] ) ) {
//检查是否填写必填参数
if ( ! isset( $this->params[ $key ] ) ) {
if ( isset( $defined[1] ) ) {
$this->params[ $key ] = $defined[1];
} else {
$this->error = "请填写 $key ";
return FALSE;
}
}
continue;
}
//如果未定义验证规则 继续下一个变量
if ( $defined[2] == 'file' ) {
continue;
}
//检查是否填写必填参数
if ( ! isset( $this->params[ $key ] ) ) {
if ( isset( $defined[1] ) ) {
$this->params[ $key ] = $defined[1];
} else {
$this->error = "请填写 $key ";
return FALSE;
}
}
$value = trim( $this->params[ $key ] );
$rule = $defined[2];
if ( is_array( $rule ) ) {
if ( ! isset( $rule[ $value ] ) ) {
$this->error = "请填写正确的 $key ";
return FALSE;
}
} else {
switch ( $rule ) {
case PARAM_REQUIRED :
//判断必填
if ( $value === '' && empty( $value ) ) {
$this->error = "请填写 $key ";
return FALSE;
}
if ( $key == 'merId' ) {
$this->merId = $value;
}
break;
case PARAM_DIGIT:
//判断是数字
if ( ! is_numeric( $value ) ) {
$this->error = " $key 不是是数字";
return FALSE;
}
break;
case PARAM_POSITIVE :
//判断是否是正数
if ( ! is_numeric( $value ) || $value <= 0 ) {
$this->error = " $key 必须大于0";
return FALSE;
}
break;
}
}
}
return TRUE;
}
/**
* 格式化数据
*
* @param $data
* @param $defaultResponse
*
* @return array
*/
public function formatData( $data , $defaultResponse = [] ) {
if ( empty( $data ) ) {
return [];
}
if ( empty( $defaultResponse ) ) {
$method = strtolower( request()->method() );
$defaultResponse = $this->defaultResponse[ $method ];
}
if ( empty( $defaultResponse ) ) {
return $data;
}
$newData = [];
if ( isset( $data[0] ) ) {
foreach ( $data as $item ) {
$newData[] = $this->formatDataForRow( $defaultResponse , $item );
}
} else {
$newData = $this->formatDataForRow( $defaultResponse , $data );
}
return $newData;
}
/**
* 格式化一行数据
*
* @param $defaultResponse
* @param $data
*
* @return array
*/
private function formatDataForRow( $defaultResponse , $data ) {
$newData = [];
foreach ( $defaultResponse as $key => $defined ) {
if ( isset( $data[ $key ] ) && is_array( $data[ $key ] ) ) {
foreach ( $data[ $key ] as $k => $row ) {
$newData[ $key ][ $k ] = $this->formatDataForRow( $defined , $row );
}
} else {
if ( is_array( $defined ) && isset( $defined[1] ) && method_exists( $this , $defined[1] ) ) {
$formatter = $defined[1];
$value = isset( $data[ $key ] ) ? $data[ $key ] : '';
$newData[ $key ] = $this->$formatter( $value , $data );
} else {
$newData[ $key ] = isset( $data[ $key ] ) ? $data[ $key ] : '';
}
}
}
return $newData;
}
//格式化 图标
public function formatIcon( $value , $row = [] ) {
if ( filter_var( $value , FILTER_VALIDATE_URL , FILTER_FLAG_SCHEME_REQUIRED ) ) {
return $value;
}
return full_img_uri( $value );
}
//格式化 手机号
public function formatPhone( $value , $row = [] ) {
return substr_replace( $value , '****' , 3 , 4 );
}
/**
* 记录日志
*
* @param $key
* @param $value
*/
public function log( $key , $value = '' ) {$this->debug = true;
if ( ! $this->debug ) {
return;
}
$filename = './logs/api_log_' . date( 'Y_m_d' ) . '.txt';
if(! is_dir('./logs')){
mkdir('./logs');
}
if ( ! file_exists( $filename ) ) {
file_put_contents( $filename , '' );
chmod( $filename , 0777 );
}
$value = is_array( $value ) ? print_r( $value , TRUE ) : $value;
$text = "----------" . date( 'Y-m-d H:i:s' ) . " 开始----------\r\n";
$text .= " $key = $value \r\n";
// $text .= "----------结束----------\r\n" ;
file_put_contents( $filename , $text , FILE_APPEND );
}
public function logStat( $param ) {
$data = [
'device' => $param['device'] ,
'device_os_version' => $param['deviceOsVersion'] ,
'app_version' => $param['appVersion'] ,
'api_version' => $param['apiVersion'] ,
'uri' => request()->url( TRUE ) ,
'ip' => request()->ip( 0 , TRUE )
];
DB::table( 'sys_api_log' )->insert( $data );
}
protected function statistics($data){
$data_r['num'] = array_sum(array_column($data,'num'));
$data_r['num1'] = array_sum(array_column($data,'num1'));
$data_r['amount'] = array_sum(array_column($data,'pay_amount'));
$data_r['payment'] = array_sum(array_column($data,'goods_amount'));
return $data_r;
}
}
================================================
FILE: resources/Api/Service/v1/system/AreaService.php
================================================
<?php namespace App\Api\Service\v1\system;
/**
* 区域
* User: MR.Z < zsh2088@gmail.com >
* Date: 2017/9/18
* Time: 21:28
*/
use App\Api\Service\v1\ApiService;
use Smart\Service\SysAreaService;
class AreaService extends ApiService {
//允许的请求方式
public $allowRequestMethod = [
'get' => 'GET - 取区域' ,
];
/**
* 传参 如:
* 'title' => ['标题' , '默认值' , '验证方式'] //验证方式可选
* 'status' => ['状态' , 1 , ["0" => '禁用' , 1 => '启用'] ]
*/
public $defaultParams = [
'get' => [
'pid' => [ '上级ID' , '0' , PARAM_REQUIRED ] ,
] ,
];
/**
* 返回结果示例 如:
*
* 'user_id' => '用户ID',
* 'icon' => ['头像' , 'formatIcon'] , //第二个值为格式化方法
*/
public $defaultResponse = [
'get' => [
"id" => "区域ID" ,
"pid" => "上级ID" ,
"text" => "区域名称" ,
] ,
];
private static $instance;
public static function instance( $params = [] ) {
if ( self::$instance == NULL ) {
self::$instance = new AreaService();
self::$instance->params = $params;
}
return self::$instance;
}
/**
* 接口响应方法
*
* @return array
*/
public function response() {
if ( ! $this->validParams() ) {
return api_result( $this->error , 500 );
}
//处理业务
switch ( request()->method() ) {
case 'GET' :
$data = $this->get();
$data = $this->formatData( $data );
return api_result( '查询成功' , 0 , [ 'rows' => $data ] );
default :
return api_result( '未知请求类型' , 500 );
}
}
/**
* get 的响应方法
*
* @return array|number
*/
public function get() {
$cacheName = config( 'custom.areaCachePrefix' ) . $this->params['pid'];
$data = cache( $cacheName );
if ( empty( $data ) ) {
$SysArea = SysAreaService::instance();
$data = $SysArea->getByCond( [
'pid' => $this->params['pid'] ,
'status' => 1 ,
'getAll' => TRUE
] );
cache( $cacheName , $data , 86400 );
}
return $data;
}
}
================================================
FILE: resources/Api/Service/v1/test/LoginService.php
================================================
<?php
namespace App\Api\Service\v1\test;
/**
* 测试
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2017-11-14
*/
use App\Api\Service\v1\ApiService;
class LoginService extends ApiService {
//允许的请求方式
public $allowRequestMethod = [
'get' => 'GET - 取测试',
'post' => 'POST - 设置测试',
'put' => 'PUT - 设置测试',
'delete' => 'DELETE - 设置测试'
];
/**
* 传参 如:
* 'title' => ['标题' , '默认值' , '验证方式'] //验证方式可选
* 'status' => ['状态' , 1 , ["0" => '禁用' , 1 => '启用'] ]
*/
public $defaultParams = [
'get' => [
// 'api_token' => [ 'token' , '0' , PARAM_REQUIRED ] ,
],
'post' => [
],
'put' => [
],
'delete' => [
]
];
/**
* 返回结果示例 如:
*
* 'user_id' => '用户ID',
* 'icon' => ['头像' , 'formatIcon'] , //第二个值为格式化方法
*/
public $defaultResponse = [
'get' => [],
'post' => [],
'put' => [],
'delete' => []
];
private static $instance;
public static function instance( $params = [] ) {
if ( self::$instance == NULL ) {
self::$instance = new LoginService();
self::$instance->params = $params ;
}
return self::$instance;
}
/**
* 接口响应方法
*
* @return array
*/
public function response() {
//验证用户
if ( ! $this->validToken() ) {
return api_result( $this->error, $this->errCode );
}
if ( ! $this->validParams() ) {
return api_result( $this->error, 500 );
}
//处理业务
switch ( request()->method() ) {
case 'GET' :
$data = $this->get();
$data = $this->formatData( $data );
return api_result( '查询成功' , 0 , [ 'rows' => $data ] );
case 'POST' :
return $this->post();
case 'PUT' :
return $this->put();
case 'DELETE' :
return $this->delete();
default :
return api_result( '未知请求类型' , 500 );
}
}
/**
* get 的响应方法
*
* @return array|number
*/
public function get() {
return [
['id' => 1 , 'text' => '测试数据']
];
}
/**
* post 的响应方法
*
* @return array
*/
public function post() {
$data = [];
return api_result( 'post 成功', 0 , $data );
}
/**
* post 的响应方法
*
* @return array
*/
public function put() {
$data = [];
return api_result( 'put 成功', 0 , $data );
}
/**
* post 的响应方法
*
* @return array
*/
public function delete() {
$data = [];
return api_result( 'delete 成功', 0 , $data );
}
}
================================================
FILE: resources/Api/routes.php
================================================
<?php
/**
* Created by PhpStorm.
* User: MR.Z < zsh2088@gmail.com >
* Date: 2017/11/14
* Time: 16:12
*/
//接口路由
Route::group(['prefix'=>'api/{version}','namespace'=>'App\Api' , 'middleware'=> ['api','auth.token','auth.cors']],function(){
Route::any('{direction}/{action}' , 'Index@index');
});
================================================
FILE: resources/Models/MerAlbum.php
================================================
<?php namespace App\Models;
/**
* MerAlbum Model
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2017-09-30
*/
use Illuminate\Database\Eloquent\Model;
class MerAlbum extends Model {
public $table = 'mer_album';
public $primaryKey = 'id';
public $timestamps = FALSE;
use \Smart\Traits\Service\Scope;
}
================================================
FILE: resources/Models/MerAlbumTag.php
================================================
<?php namespace App\Models;
/**
* MerAlbumTag Model
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2017-10-02
*/
use Illuminate\Database\Eloquent\Model;
class MerAlbumTag extends Model {
public $table = 'mer_album_tag';
public $primaryKey = 'id';
public $timestamps = FALSE;
use \Smart\Traits\Service\Scope;
}
================================================
FILE: resources/Models/MerArticles.php
================================================
<?php namespace App\Models;
/**
* MerArticles Model
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2017-09-30
*/
use Illuminate\Database\Eloquent\Model;
class MerArticles extends Model {
public $table = 'mer_articles';
public $primaryKey = 'id';
public $timestamps = FALSE;
use \Smart\Traits\Service\Scope;
}
================================================
FILE: resources/Models/MerGoodsCatalog.php
================================================
<?php namespace App\Models;
/**
* MerGoodsCatalog Model
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2017-09-30
*/
use Illuminate\Database\Eloquent\Model;
class MerGoodsCatalog extends Model {
public $table = 'mer_goods_catalog';
public $primaryKey = 'id';
public $timestamps = FALSE;
use \Smart\Traits\Service\Scope;
}
================================================
FILE: resources/Models/SysUser.php
================================================
<?php
namespace Smart\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Spatie\Permission\Traits\HasRoles;
class SysUser extends Authenticatable {
use Notifiable;
use HasRoles;
protected $table = 'sys_user';
public $primaryKey = 'id';
public $timestamps = FALSE;
use \Smart\Traits\Service\Scope;
public function sysMerchants() {
return $this->belongsToMany('App\Models\SysMerchant', 'mer_sys_user', 'sys_user_id', 'mer_id');
}
public function scopeKeyword($query, $param) {
if ($param) {
return $query->where(function ($query) use ($param) {
$query->orWhere('username', 'like', "%{$param}%")->orWhere('phone', 'like', "%{$param}%");
});
}
}
public function username() {
return 'name';
}
}
================================================
FILE: resources/Models/User.php
================================================
<?php
namespace App\Models;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
protected $table = 'sys_user';
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
}
================================================
FILE: resources/Service/MerTokenService.php
================================================
<?php namespace App\Service;
/**
* Created by PhpStorm.
* User: MR.Z < zsh2088@gmail.com >
* Date: 2017/9/30
* Time: 15:33
*/
use Illuminate\Support\Facades\DB;
use Smart\Interfaces\TokenService;
use Smart\Service\BaseService;
class MerTokenService extends BaseService implements TokenService{
public function getByToken($token){
$data = DB::table('sys_user as su')
->join('mer_sys_user as msu' , 'su.id' , '=' , 'msu.sys_user_id')
->join('mer_user as mu' , 'mu.id','=' , 'msu.id')
->where('su.token' , $token)
->first();
return $data;
}
}
================================================
FILE: resources/assets/static/.gitignore
================================================
================================================
FILE: resources/assets/static/js/backend/Generate.js
================================================
/**
* 自动生成代码 JS
*
* @author Zix
* @version 2.0 , 2016-09-11
*/
var Generate = {
token : $('input[name=_token]').val(),
config : {
fileExists : null
} ,
init : function () {
//初始化ajax 提示框
loading.initAjax();
//初始化查询form
this.initBtn();
$('#systemForm').reloadForm(Param.systemDefault);
$('#systemComponentsForm').reloadForm(Param.systemComponentsDefault);
$('#apiForm').reloadForm(Param.apiDefault);
this.getSystemInfo();
$(".select2").select2({
tags : true ,
tokenSeparators : [',' , ' ']
});
} ,
//初始化各种按钮
initBtn : function () {
var self = this;
$('input[name="module"]').change(function () {
self.getSystemInfo();
});
$('select[name="tableName"]').change(function () {
self.getSystemInfo();
});
$('#getSystemInfoBtn').on('click' , function (e) {
e.preventDefault();
self.getSystemInfo();
});
//创建系统页面
$('.createSystemBtn').on('click' , function (e) {
e.preventDefault();
var $thisBtn = $(this);
var temp = $(this).data('temp');
var systemData = $('#systemForm').serializeObject();
var componentsData = $('#systemComponentsForm').serializeObject();
var data = {
temp : temp ,
module : systemData.module ,
tableName : systemData.tableName ,
components : componentsData ,
_token : self.token
};
$.post(Param.uri.createSystem , data)
.fail(function (res) {
tips.error(res.responseText);
})
.done(function (res) {
if ( res.code == 401 ) {
//需要登录
tips.error('请先登录');
} else if ( res.code != 0 ) {
tips.error(res.msg);
} else {
tips.success(res.msg);
if ( data.temp == 'all' ) {
for( var key in self.config.fileExists ) {
if ( !self.config.fileExists.hasOwnProperty( key ) ) {
continue;
}
self.config.fileExists[key] = true ;
}
$('.createSystemBtn').prop('disabled' , true);
$('.deleteSystemBtn').prop('disabled' , false);
} else {
$('.deleteSystemBtn[data-temp="' + temp + '"]').prop('disabled' , false);
self.config.fileExists[data.temp] = true ;
$thisBtn.prop('disabled' , true);
}
}
});
});
//创建接口
$('#createApiBtn').on('click' , function (e) {
e.preventDefault();
var data = $('#apiForm').serializeObject();
data._token = self.token;
if ( empty(data.desc) ) {
tips.error('描述不能为空');
}
if ( empty(data.directory) ) {
tips.error('目录不能为空');
}
if ( empty(data.name) ) {
tips.error('名称不能为空');
}
$.post(Param.uri.createApi , data)
.fail(function (res) {
})
.done(function (res) {
if ( res.code == 0 ) {
tips.success(res.msg);
} else {
tips.error(res.msg);
}
});
});
$('.deleteSystemBtn').on('click' , function (e) {
e.preventDefault();
var $thisBtn = $(this);
var temp = $(this).data('temp');
if ( ! self.config.fileExists[temp] ) {
tips.error(temp + '文件不存在');
return false ;
}
var data = $('#systemForm').serializeObject();
data['temp'] = temp;
sure.init('确认删除' + temp + '文件吗?' , function () {
$.get(Param.uri.destroySystemFile , data)
.fail(function (res) {
tips.error(res.responseText);
})
.done(function (res) {
if ( res.code != 0 ) {
tips.error(res.msg);
} else {
$('.createSystemBtn[data-temp="' + temp + '"]').prop('disabled' , false);
$thisBtn.prop('disabled' , true);
self.config.fileExists[temp] = false;
$('.createSystemBtn[data-temp="all"]').prop('disabled' , false);
tips.success(res.msg);
}
});
});
});
} ,
getSystemInfo : function () {
var self = this;
var $form = $('#systemForm');
var data = $form.serializeObject();
data['type'] = $("#type_tabs").find("li.active > a").data('type');
$.get(Param.uri.getSystemInfo , data)
.fail(function (res) {
tips.error(res.responseText);
})
.done(function (res) {
if ( res.code == 401 ) {
//需要登录
tips.error('请先登录');
} else if ( res.code != 0 ) {
tips.error(res.msg);
} else {
tips.success(res.msg);
var allFileExists = true;
self.config.fileExists = res.data.fileExists;
$.each( res.data.fileExists , function (key , val) {
$('.createSystemBtn[data-temp="' + key + '"]').prop('disabled' , val);
$('.deleteSystemBtn[data-temp="' + key + '"]').prop('disabled' , ! val);
if ( allFileExists && ! val ) {
allFileExists = false;
}
});
$('.createSystemBtn[data-temp="all"]').prop('disabled' , allFileExists);
self.setSelect(res.data);
}
});
} ,
setSelect : function (data) {
var html = [];
html.push('<option value="">请选择</option>');
for ( var i = 0 ; i < data.fieldInfo.length ; i ++ ) {
var field = data.fieldInfo[i]['fieldName'];
var common = data.fieldInfo[i]['fieldComment'];
html.push('<option value="' + field + '">' + field + ' (' + common + ')' + '</option>');
}
$('select[name="upload"]').html(html.join('')).val(data.components.upload).trigger('change');
$('select[name="editor"]').html(html.join('')).val(data.components.editor).trigger('change');
$('select[name="select2"]').html(html.join(''));
}
};
================================================
FILE: resources/assets/static/js/backend/Index.js
================================================
var Index = {
init : function(){
// 指定图表的配置项和数据
var usersOption = {
tooltip : {
trigger : 'axis'
} ,
legend : {
data : ['用户注册']
} ,
grid : {
left : '3%' ,
right : '4%' ,
bottom : '3%' ,
containLabel : true
} ,
xAxis : [
{
type : 'category' ,
boundaryGap : true ,
data : Param.charts.users.period
}
] ,
yAxis : [
{
type : 'value'
}
] ,
series : [
{
name : '注册人数' ,
type : 'line' ,
data : Param.charts.users.data
}
]
};
var apiOption = {
color: ['#3398DB'],
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
grid : {
left : '3%' ,
right : '4%' ,
bottom : '3%' ,
containLabel : true
} ,
xAxis : [
{
type : 'category' ,
data : Param.charts.api.period,
axisTick: {
alignWithLabel: true
}
}
] ,
yAxis : [
{
type : 'value'
}
] ,
series : [
{
name : '访问量' ,
type : 'bar' ,
barWidth: '60%',
label: {
normal: {
show: true,
position: 'top'
}
},
data : Param.charts.api.data
}
]
};
var userChart = echarts.init(document.getElementById('userChart'));
userChart.setOption(usersOption);
var apiChart = echarts.init(document.getElementById('apiChart'));
apiChart.setOption(apiOption);
}
};
================================================
FILE: resources/assets/static/js/backend/MerAd.js
================================================
/**
* MerAd JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-14
*/
var MerAd = {
init : function () {
//重新设置菜单
if ( !empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink('set' , 'a[data-uri="'+ Param.uri.menu +'"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click' , function (e) {
e.preventDefault();
var $dataGrid = $('#dataGrid');
var param = $dataGrid.TableGrid('getParam');
param = $.extend({} , param , $('#searchForm').serializeObject() );
param.page = 1;
$dataGrid.TableGrid('setParam' , param);
$dataGrid.TableGrid('reload');
});
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $('#tablePortlet') ;
var $addEditPortlet = $('#addEditPortlet');
$tablePortlet.slideUp('fast');
if ( type == 'add' ) {
if ( !$addEditPortlet.hasClass('blue') ) {
$addEditPortlet.removeClass('green-meadow').addClass('blue');
}
$addEditPortlet.find('.caption-subject').html('新建' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( !$addEditPortlet.hasClass('green-meadow') ) {
$addEditPortlet.removeClass('blue').addClass('green-meadow');
}
$addEditPortlet.find('.caption-subject').html('编辑' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
},
//关闭 portlet
setPortletHide : function () {
$('#tablePortlet').slideDown('fast') ;
$('#addEditPortlet').slideUp('fast');
},
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$('#addNewBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm( Param.defaultRow );
setImgPreview.clear('icon');
setImgPreview.clear('icon');
$form.attr('action' , Param.uri.insert );
});
//编辑按钮
$(document).on('click' , '.editBtn' , function (e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#dataGrid').TableGrid('getRow' , id);
var $form = $('#addEditForm');
$form.reloadForm( row );
setImgPreview.set('icon' , row.icon);
setImgPreview.set('icon' , row.icon);
setImgPreview.set('icon' , row.icon);
$form.attr('action' , Param.uri.update + row.id );
});
//删除一行
$(document).on('click' , '.destroyBtn' , function (e) {
e.preventDefault();
var id = $(this).data('id');
self.delData( id );
});
$('#destroySelectBtn').on('click' , function (e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error('请选择要删除的记录');
return ;
}
self.delData( ids );
});
//提交添加编辑窗
$('#submitFormBtn').on('click' , function (e) {
e.preventDefault();
var $form = $('#addEditForm');
if( $form.validForm() ) {
var data = $form.serializeObject();
$.post( $form.attr('action') , data )
.fail( function(res){
tips.error( res.responseText );
})
.done( function( res ){
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletHide();
});
//上传按钮
$('#iconUploadBtn').Uploader({
uri : Param.uri.upload , //上传文件
param : Param.uploadParam ,
album : true ,
albumUri : Param.uri.album ,
albumCatalogUri : Param.uri.albumCatalog ,
albumParam : Param.albumParam ,
onSuccess : function ( ret ) {
tips.success(ret.msg);
if ( ret.code == 0 ) {
setImgPreview.set('icon' , ret.data.savePath);
}
},
onChooseAlbum : function( uri ){
setImgPreview.set('icon' , uri );
}
});
} ,
delData : function ( ids ) {
var self = this ;
var data = {
ids : ids
};
sure.init('是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function(res){
tips.error( res.responseText );
})
.done(function (res) {
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
}
});
});
},
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query , '' , uri);
$('#dataGrid').TableGrid({
uri : Param.uri.read ,
selectAll : true ,
param : Param.query ,
rowStyle : function (row) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if ( oldUri == uri) {
return false ;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params , '' , oldUri);
history.replaceState(settings.param , '' , uri);
}
});
}
};
//pop state 事件
window.onpopstate = function (event) {
if ( event && event.state ) {
$('#searchForm').reloadForm( event.state );
var $dataGrid = $('#dataGrid');
$dataGrid.TableGrid('setParam' , event.state);
$dataGrid.TableGrid('reload');
}
};
================================================
FILE: resources/assets/static/js/backend/MerEvent.js
================================================
/**
* MerEvent JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2017-07-17
*/
var MerEvent = {
config : {} ,
init : function () {
//重新设置菜单
if ( !empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink('set' , 'a[data-uri="'+ Param.uri.menu +'"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
KE_OPTIONS.uploadJson = Param.uri.uploadKE ;
this.config['content'] = KindEditor.create('textarea[name="content"]' , KE_OPTIONS );
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click' , function (e) {
e.preventDefault();
var $dataGrid = $('#dataGrid');
var param = $dataGrid.TableGrid('getParam');
param = $.extend({} , param , $('#searchForm').serializeObject() );
param.page = 1;
$dataGrid.TableGrid('setParam' , param);
$dataGrid.TableGrid('reload');
});
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $('#tablePortlet') ;
var $addEditPortlet = $('#addEditPortlet');
$tablePortlet.slideUp('fast');
if ( type == 'add' ) {
if ( !$addEditPortlet.hasClass('blue') ) {
$addEditPortlet.removeClass('green-meadow').addClass('blue');
}
$addEditPortlet.find('.caption-subject').html('新增 ' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( !$addEditPortlet.hasClass('green-meadow') ) {
$addEditPortlet.removeClass('blue').addClass('green-meadow');
}
$addEditPortlet.find('.caption-subject').html('编辑 ' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
},
//关闭 portlet
setPortletHide : function () {
$('#tablePortlet').slideDown('fast') ;
$('#addEditPortlet').slideUp('fast');
},
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$('#addNewBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm( Param.defaultRow );
setImgPreview.clear('icon');
setImgPreview.clear('icon');
self.config['content'].html('');
$form.attr('action' , Param.uri.insert );
});
//编辑按钮
$(document).on('click' , '.editBtn' , function (e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#dataGrid').TableGrid('getRow' , id);
var $form = $('#addEditForm');
$form.reloadForm( row );
setImgPreview.set('icon' , row.icon);
setImgPreview.set('icon' , row.icon);
setImgPreview.set('icon' , row.icon);
self.config['content'].html( row.content );
$form.attr('action' , Param.uri.update + row.id );
});
//删除一行
$(document).on('click' , '.destroyBtn' , function (e) {
e.preventDefault();
var id = $(this).data('id');
self.delData( id );
});
$('#destroySelectBtn').on('click' , function (e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error('请选择要删除的记录');
return ;
}
self.delData( ids );
});
//提交添加编辑窗
$('#submitFormBtn').on('click' , function (e) {
e.preventDefault();
var $form = $('#addEditForm');
if( $form.validForm() ) {
var data = $form.serializeObject();
$.post( $form.attr('action') , data )
.fail( function(res){
tips.error( res.responseText );
})
.done( function( res ){
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletHide();
});
//上传按钮
$('#iconUploadBtn').Uploader({
uri : Param.uri.upload , //上传文件
param : Param.uploadParam ,
album : true ,
albumUri : Param.uri.album ,
albumCatalogUri : Param.uri.albumCatalog ,
albumParam : Param.albumParam ,
onSuccess : function ( ret ) {
tips.success(ret.msg);
if ( ret.code == 0 ) {
setImgPreview.set('icon' , ret.data.savePath);
}
},
onChooseAlbum : function( uri ){
setImgPreview.set('icon' , uri );
}
});
} ,
delData : function ( ids ) {
var self = this ;
var data = {
ids : ids
};
sure.init('是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function(res){
tips.error( res.responseText );
})
.done(function (res) {
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
}
});
});
},
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query , '' , uri);
$('#dataGrid').TableGrid({
uri : Param.uri.read ,
selectAll : true ,
param : Param.query ,
rowStyle : function (row) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if ( oldUri == uri) {
return false ;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params , '' , oldUri);
history.replaceState(settings.param , '' , uri);
}
});
}
};
//pop state 事件
window.onpopstate = function (event) {
if ( event && event.state ) {
$('#searchForm').reloadForm( event.state );
var $dataGrid = $('#dataGrid');
$dataGrid.TableGrid('setParam' , event.state);
$dataGrid.TableGrid('reload');
}
};
================================================
FILE: resources/assets/static/js/backend/MerFunc.js
================================================
/**
* MerFunc JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-12
*/
var MerFunc = {
token: $('input[name=_token]').val(),
init: function() {
//重新设置菜单
if (!empty(Param.uri.menu)) {
Layout.setSidebarMenuActiveLink('set', 'a[data-uri="' + Param.uri.menu + '"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
},
//初始化查询form
initSearchForm: function() {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click', function(e) {
e.preventDefault();
var $treeGrid = $('#treeGrid');
var param = $treeGrid.TreeGrid('getParam');
param = $.extend({}, param, $('#searchForm').serializeObject());
param.page = 1;
$treeGrid.TreeGrid('setParam', param);
$treeGrid.TreeGrid('reload');
Param.defaultRow.module = param.module
});
},
//显示 modal
setPortletShow: function(type) {
var $addEditModal = $('#addEditModal');
$addEditModal.modal('show');
if (type == 'add') {
$addEditModal.find('.caption-subject').html('新建' + Param.pageTitle);
} else if (type == 'edit') {
$addEditModal.find('.caption-subject').html('编辑' + Param.pageTitle);
}
},
//关闭 modal
setPortletHide: function() {
$('#addEditModal').modal('hide');
},
//初始化各种按钮
initBtn: function() {
var self = this;
//打开添加框
$('#addNewBtn').on('click', function(e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm(Param.defaultRow);
$form.attr('action', Param.uri.insert);
});
//编辑按钮
$(document).on('click', '.editBtn', function(e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#treeGrid').TreeGrid('getRow', id);
var $form = $('#addEditForm');
$form.reloadForm(row);
$form.attr('action', Param.uri.update + '/' + row.id);
});
//删除一行
$(document).on('click', '.destroyBtn', function(e) {
e.preventDefault();
var id = $(this).data('id');
self.delData(id);
});
$('#destroySelectBtn').on('click', function(e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if (empty(ids)) {
tips.error('请选择要删除的记录');
return;
}
self.delData(ids);
});
//提交添加编辑窗
$('#submitFormBtn').on('click', function(e) {
e.preventDefault();
var $form = $('#addEditForm');
if ($form.validForm()) {
var data = $form.serializeObject();
data._token = self.token;
$.post($form.attr('action'), data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 1001) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#treeGrid').TreeGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click', function(e) {
e.preventDefault();
self.setPortletHide();
});
//打开权限窗口
$(document).on('click', '.privilegeBtn', function(e) {
e.preventDefault();
var id = $(this).data('id');
var data = $('#treeGrid').TreeGrid('getRow', id);
var privilege = data.privilege;
var $form = $('#privilegeForm');
$form[0].reset();
if (!empty(privilege)) {
$.each(privilege, function(index, item) {
$form.find('input[value="' + item.name + '"]').prop('checked', true);
});
}
$form.attr('action', Param.uri.updatePrivilege + '/' + id);
$('#privilegeModal').modal('show');
});
//更新权限
$('#submitPrivilegeFormBtn').on('click', function(e) {
e.preventDefault();
var $form = $('#privilegeForm');
var uri = $form.attr('action');
var data = $form.serializeObject();
$.post(uri, data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 403) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#treeGrid').TreeGrid('reload');
$('#privilegeModal').modal('hide');
}
});
})
},
delData: function(ids) {
var data = {
ids: ids,
_token: this.token
};
sure.init('是否删除?', function() {
$.post(Param.uri.destroy, data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 1001) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#treeGrid').TreeGrid('reload');
}
});
});
},
//初始化tree grid
initGrid: function() {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query, '', uri);
$('#treeGrid').TreeGrid({
uri: Param.uri.read,
field: 'name', //显示箭头的字段
param: Param.query, //查询参数
expandAll: true,
rowStyle: function(row) {
if (row.status == 0) {
return 'warning';
}
},
loadSuccess: function(rows, settings) {
var options = '<option value="0" selected>根目录</option>';
options += form_options_rows(rows, settings);
$('select[name="pid"]').html(options);
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if (oldUri == uri) {
return false;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params, '', oldUri);
history.replaceState(settings.param, '', uri);
}
});
}
};
//pop state 事件
window.onpopstate = function(event) {
if (event && event.state) {
$('#searchForm').reloadForm(event.state);
var $treeGrid = $('#treeGrid');
$treeGrid.TreeGrid('setParam', event.state);
$treeGrid.TreeGrid('reload');
}
};
var formatName = function(value, row) {
var html = value;
if (!empty(row.icon)) {
html = '<i class="' + row.icon + '"></i> ' + html;
}
return html;
};
var formatIsFunc = function(value) {
return Param.isFunc[value];
};
var formatIsMenu = function(value) {
return Param.isMenu[value];
};
var optPrivilege = function(value, row) {
return '<a href="#" data-id="' + row.id + '" class="btn btn-sm blue privilegeBtn"><i class="fa fa-key"></i> 权限</a>';
};
================================================
FILE: resources/assets/static/js/backend/MerGoodsCatalog.js
================================================
/**
* MerGoodsCatalog JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-10-11
*/
var MerGoodsCatalog = {
token : $('input[name=_token]').val(),
config : {} ,
init : function () {
//重新设置菜单
if ( !empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink('set' , 'a[data-uri="'+ Param.uri.menu +'"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click' , function (e) {
e.preventDefault();
var $treeGrid = $('#treeGrid');
var param = $treeGrid.TreeGrid('getParam');
param = $.extend({} , param , $('#searchForm').serializeObject() );
param.page = 1;
$treeGrid.TreeGrid('setParam' , param);
$treeGrid.TreeGrid('reload');
});
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $('#tablePortlet') ;
var $addEditPortlet = $('#addEditPortlet');
$tablePortlet.slideUp('fast');
if ( type == 'add' ) {
if ( !$addEditPortlet.hasClass('blue') ) {
$addEditPortlet.removeClass('green-meadow').addClass('blue');
}
$addEditPortlet.find('.caption-subject').html('新增 ' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( !$addEditPortlet.hasClass('green-meadow') ) {
$addEditPortlet.removeClass('blue').addClass('green-meadow');
}
$addEditPortlet.find('.caption-subject').html('编辑 ' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
},
//关闭 portlet
setPortletHide : function () {
$('#tablePortlet').slideDown('fast') ;
$('#addEditPortlet').slideUp('fast');
},
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$('#addNewBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm( Param.defaultRow );
setImgPreview.clear('icon');
setImgPreview.clear('icon');
$form.attr('action' , Param.uri.insert );
});
//编辑按钮
$(document).on('click' , '.editBtn' , function (e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#treeGrid').TreeGrid('getRow' , id);
var $form = $('#addEditForm');
$form.reloadForm( row );
setImgPreview.set('icon' , row.icon);
setImgPreview.set('icon' , row.icon);
setImgPreview.set('icon' , row.icon);
$form.attr('action' , Param.uri.update+'/' + row.id );
});
//删除一行
$(document).on('click' , '.destroyBtn' , function (e) {
e.preventDefault();
var id = $(this).data('id');
self.delData( id );
});
$('#destroySelectBtn').on('click' , function (e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error('请选择要删除的记录');
return ;
}
self.delData( ids );
});
//提交添加编辑窗
$('#submitFormBtn').on('click' , function (e) {
e.preventDefault();
var $form = $('#addEditForm');
if( $form.validForm() ) {
var data = $form.serializeObject();
data._token = self.token;
$.post( $form.attr('action') , data )
.fail( function(res){
tips.error( res.responseText );
})
.done( function( res ){
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#treeGrid').TreeGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletHide();
});
//上传按钮
$('#iconUploadBtn').Uploader({
uri : Param.uri.upload , //上传文件
param : Param.uploadParam ,
album : true ,
albumUri : Param.uri.album ,
albumCatalogUri : Param.uri.albumCatalog ,
albumParam : Param.albumParam ,
onSuccess : function ( ret ) {
tips.success(ret.msg);
if ( ret.code == 0 ) {
setImgPreview.set('icon' , ret.data.savePath);
}
},
onChooseAlbum : function( uri ){
setImgPreview.set('icon' , uri );
}
});
} ,
delData : function ( ids ) {
var self = this ;
var data = {
ids : ids,
_token : self.token
};
sure.init('是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function(res){
tips.error( res.responseText );
})
.done(function (res) {
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#treeGrid').TreeGrid('reload');
}
});
});
},
//初始化tree grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query , '' , uri);
$('#treeGrid').TreeGrid({
uri : Param.uri.read ,
field : 'text', //显示箭头的字段
param : Param.query , //查询参数
rowStyle : function (row) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var options = '<option value="0" selected>根目录</option>';
options += form_options_rows( rows , settings );
$('select[name="pid"]').html(options);
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if ( oldUri == uri) {
return false ;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params , '' , oldUri);
history.replaceState(settings.param , '' , uri);
}
});
}
};
//pop state 事件
window.onpopstate = function (event) {
if ( event && event.state ) {
$('#searchForm').reloadForm( event.state );
var $treeGrid = $('#treeGrid');
$treeGrid.TreeGrid('setParam' , event.state);
$treeGrid.TreeGrid('reload');
}
};
================================================
FILE: resources/assets/static/js/backend/MerRole.js
================================================
/**
* MerRole JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-12
*/
var MerRole = {
token: $('input[name=_token]').val(),
config: {},
init: function() {
//重新设置菜单
if (!empty(Param.uri.menu)) {
Layout.setSidebarMenuActiveLink('set', 'a[data-uri="' + Param.uri.menu + '"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
},
//初始化查询form
initSearchForm: function() {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click', function(e) {
e.preventDefault();
var $dataGrid = $('#dataGrid');
var param = $dataGrid.TableGrid('getParam');
param = $.extend({}, param, $('#searchForm').serializeObject());
param.page = 1;
$dataGrid.TableGrid('setParam', param);
$dataGrid.TableGrid('reload');
Param.defaultRow.module = param.module
});
},
//显示 modal
setPortletShow: function(type) {
var $addEditModal = $('#addEditModal');
$addEditModal.modal('show');
if (type == 'add') {
$addEditModal.find('.caption-subject').html('新增 ' + Param.pageTitle);
} else if (type == 'edit') {
$addEditModal.find('.caption-subject').html('编辑 ' + Param.pageTitle);
}
},
//关闭 modal
setPortletHide: function() {
$('#addEditModal').modal('hide');
},
//初始化各种按钮
initBtn: function() {
var self = this;
//打开添加框
$('#addNewBtn').on('click', function(e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm(Param.defaultRow);
$form.attr('action', Param.uri.insert);
});
//编辑按钮
$(document).on('click', '.editBtn', function(e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#dataGrid').TableGrid('getRow', id);
var $form = $('#addEditForm');
$form.reloadForm(row);
$form.attr('action', Param.uri.update + '/' + row.id);
});
//删除一行
$(document).on('click', '.destroyBtn', function(e) {
e.preventDefault();
var id = $(this).data('id');
self.delData(id);
});
$('#destroySelectBtn').on('click', function(e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if (empty(ids)) {
tips.error('请选择要删除的记录');
return;
}
self.delData(ids);
});
//提交添加编辑窗
$('#submitFormBtn').on('click', function(e) {
e.preventDefault();
var $form = $('#addEditForm');
if ($form.validForm()) {
var data = $form.serializeObject();
$.post($form.attr('action'), data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 403) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#dataGrid').TableGrid('reload');
self.setPortletHide();
}
});
}
});
//打开权限窗口
$(document).on('click', '.permissionBtn', function(e) {
e.preventDefault();
$('#permissionBody').empty();
var id = $(this).data('id');
var roleData = $('#dataGrid').TableGrid('getRow', id);
self.config.roleId = id;
var url = Param.uri.getPermission;
var data = {
roleId: id,
_token: self.token
};
$.post(url, data, function(res) {
$('#permissionLabel').html('[' + roleData.name + ']的权限');
$('#permissionModal').modal('show');
$('#permissionBody').html(res);
var url = Param.uri.getPrivilegeData;
$.post(url, data, function(res) {
self.initPermission(res);
});
});
});
//关闭添加编辑窗
$('#closePortletBtn').on('click', function(e) {
e.preventDefault();
self.setPortletHide();
});
//功能权限全选或取消
$(document).on('click', '.func', function(e) {
e.preventDefault();
var this_node = $(this).parent('.func-node');
var opt = this_node.find('.func-opt');
var opt_i = this_node.find('.func-opt > i');
if ($(this).hasClass('disabled') || $(this).hasClass('notall')) {
//全选
$(this).removeClass('active notall disabled').addClass('active');
opt.removeClass('active notall disabled').addClass('active');
opt_i.removeClass('fa-square-o').addClass('fa-check-square-o');
//将下级权限置为可查看
self.setSubOptCheck(this_node);
} else {
//全不选
$(this).removeClass('active notall disabled').addClass('disabled');
opt.removeClass('active notall disabled').addClass('disabled');
opt_i.removeClass('fa-check-square-o').addClass('fa-square-o');
//将下级权限置为全不选
self.setSubOptDisabled(this_node);
}
});
//功能权限单选或取消
$(document).on('click', '.func-opt', function(e) {
e.preventDefault();
var this_i = $(this).find('i');
var this_node = $(this).parents('.func-node');
if ($(this).hasClass('disabled')) {
$(this).removeClass('disabled').addClass('active');
this_i.removeClass('fa-square-o').addClass('fa-check-square-o');
} else if ($(this).hasClass('active')) {
$(this).removeClass('active').addClass('disabled');
this_i.removeClass('fa-check-square-o').addClass('fa-square-o');
}
if ($(this).html().indexOf('查看') > 0) {
if ($(this).hasClass('disabled')) {
self.setSubOptDisabled(this_node);
} else {
self.setSubOptCheck(this_node);
}
}
this_node.find('.func').removeClass('active notall disabled');
if (this_node.find('.func-opt-row > .active').length == 0) {
this_node.find('.func').addClass('disabled'); //未选择
} else if (this_node.find('.func-opt').length == this_node.find('.func-opt-row > .active').length) {
this_node.find('.func').addClass('active'); //全选
} else {
this_node.find('.func').addClass('notall'); //部分选择
}
});
//提交权限
$(document).on('click', '#permissionSubmitBtn', function(e) {
e.preventDefault();
var data = {
roleId: self.config.roleId,
privilegeArr: [],
_token: self.token
};
var $active = $('.func-opt-row .active');
var len = $active.length;
for (var i = 0; i < len; i++) {
data.privilegeArr.push($active.eq(i).data('id'));
}
var url = Param.uri.updatePermission;
$.post(url, data, function(ret) {
if (ret.code != 0) {
tips.error(ret.msg);
return;
}
tips.success(ret.msg);
$('#permissionBody').empty();
$('#permissionModal').modal('hide');
});
});
},
delData: function(ids) {
var self = this;
var data = {
ids: ids,
_token: this.token
};
sure.init('是否删除?', function() {
$.post(Param.uri.destroy, data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 1001) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#dataGrid').TableGrid('reload');
}
});
});
},
//初始化grid
initGrid: function() {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query, '', uri);
$('#dataGrid').TableGrid({
uri: Param.uri.read,
selectAll: true,
param: Param.query,
rowStyle: function(row) {
if (row.status == 0) {
return 'warning';
}
},
loadSuccess: function(rows, settings) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if (oldUri == uri) {
return false;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params, '', oldUri);
history.replaceState(settings.param, '', uri);
}
});
},
//将下级权限置为可查看
setSubOptCheck: function(this_node) {
var self_tree = this_node.parent('.func-tree');
var _sub_func_node = self_tree.find('.sub-permission .func-node');
_sub_func_node.each(function() {
var self_sub_func_node = $(this);
$(this).find('.func-opt').each(function() {
if ($(this).html().indexOf('查看') > 0) {
self_sub_func_node.find('.func').removeClass('active notall disabled').addClass('notall');
$(this).removeClass('active notall disabled').addClass('active');
var self_sub_func_opt_i = $(this).find('i');
self_sub_func_opt_i.removeClass('fa-square-o').addClass('fa-check-square-o');
}
});
});
},
//将下级权限置为全不选
setSubOptDisabled: function(this_node) {
var self_tree = this_node.parent('.func-tree');
var _sub_func_node = self_tree.find('.sub-permission .func-node');
_sub_func_node.each(function() {
$(this).find('.func').removeClass('active notall disabled').addClass('disabled');
$(this).find('.func-opt').removeClass('active notall disabled').addClass('disabled');
$(this).find('.func-opt > i').removeClass('fa-check-square-o').addClass('fa-square-o');
});
},
//初始化
initPermission: function(privilegeData) {
$('.func').addClass('disabled');
$('.func-opt').addClass('disabled');
for (var i = 0; i < privilegeData.length; i++) {
$obj = $('.func-opt[data-id="' + privilegeData[i].privilege_id + '"]');
$obj.removeClass('disabled').addClass('active');
$obj.find('i').removeClass('fa-square-o').addClass('fa-check-square-o');
}
$('.func-node').each(function(index) {
var func_id = $(this).data('id');
var total_len = $(this).find('.func-opt').length;
var active_len = $(this).find('.active').length;
if (total_len == active_len) {
$(this).find('.func').removeClass('disabled').addClass('active');
} else if (total_len > active_len && active_len > 0) {
$(this).find('.func').removeClass('disabled').addClass('notall');
}
});
},
};
//pop state 事件
window.onpopstate = function(event) {
if (event && event.state) {
$('#searchForm').reloadForm(event.state);
var $dataGrid = $('#dataGrid');
$dataGrid.TableGrid('setParam', event.state);
$dataGrid.TableGrid('reload');
}
};
var optPermission = function(value, row) {
return '<a class="btn btn-sm btn-primary permissionBtn" data-id="' + row.id + '" href="javascript:;" >' +
'<i class="fa fa-check-square-o"></i> 授权</a>';
};
================================================
FILE: resources/assets/static/js/backend/MerSysUser.js
================================================
/**
* SysMerUser JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-27
*/
var MerSysUser = {
token : $('input[name=_token]').val(),
init : function () {
//重新设置菜单
if ( ! empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink( 'set' , 'a[data-uri="' + Param.uri.menu + '"]' );
}
//初始化ajax 提示框
loading.initAjax();
this.initBtn();
this.initSearchForm();
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $( '#searchForm' );
$searchForm.reloadForm( Param.query );
//点击查询按钮
$( '#searchBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $dataGrid = $( '#dataGrid' );
var param = $dataGrid.TableGrid( 'getParam' );
param.keyword = $.trim( $( '#keyword' ).val() );
param.status = $( '#status' ).val();
param.page = 1;
//console.log( param );
$dataGrid.TableGrid( 'setParam' , param );
$dataGrid.TableGrid( 'reload' );
} );
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $( '#tablePortlet' );
var $addEditPortlet = $( '#addEditPortlet' );
$tablePortlet.slideUp( 'fast' );
if ( type == 'add' ) {
if ( ! $addEditPortlet.hasClass( 'red' ) ) {
$addEditPortlet.removeClass( 'green-meadow' ).addClass( 'red' );
}
$addEditPortlet.find( '.caption-title' ).html( '新建' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( ! $addEditPortlet.hasClass( 'green-meadow' ) ) {
$addEditPortlet.removeClass( 'red' ).addClass( 'green-meadow' );
}
$addEditPortlet.find( '.caption-title' ).html( '编辑' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
} ,
//关闭 portlet
setPortletHide : function () {
$( '#tablePortlet' ).slideDown( 'fast' );
$( '#addEditPortlet' ).slideUp( 'fast' );
} ,
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$( '#addNewBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'add' );
var $form = $( '#addEditForm' );
$form.reloadForm( Param.defaultRow );
setImgPreview.clear( 'icon' );
$form.attr( 'action' , Param.uri.insert );
} );
//编辑按钮
$( document ).on( 'click' , '.editBtn' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'edit' );
var id = $( this ).data( 'id' );
var row = $( '#dataGrid' ).TableGrid( 'getRow' , id );
var $form = $( '#addEditForm' );
$form.reloadForm( row );
setImgPreview.set( 'icon' , row.icon );
//console.log( row.roles );
$.each( row.roles , function ( index , item ) {
$( 'input[name="roles[]"][value="' + item.role_id + '"]' ).prop( 'checked' , true );
} );
$form.attr( 'action' , Param.uri.update +'/' + row.id );
} );
//删除一行
$( document ).on( 'click' , '.destroyBtn' , function ( e ) {
e.preventDefault();
var id = $( this ).data( 'id' );
self.delData( id );
} );
$( '#destroySelectBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var ids = $( '.checker:checked' ).serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error( '请选择要删除的记录' );
return;
}
self.delData( ids );
} );
//提交添加编辑窗
$( '#submitFormBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $form = $( '#addEditForm' );
var uri = $form.attr( 'action' );
if ( $form.validForm() ) {
var data = $form.serializeObject();
$.post( $form.attr( 'action' ) , data )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code == 401 ) {
//需要登录
tips.error( '请先登录' );
} else if ( res.code != 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
self.setPortletHide();
}
} );
}
} );
//关闭添加编辑窗
$( '#closePortletBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletHide();
} );
//上传按钮
$( '#iconUploadBtn' ).Uploader( {
uri : Param.uri.upload , //上传文件
param : Param.uploadParam ,
album : true ,
albumUri : Param.uri.album ,
albumCatalogUri : Param.uri.albumCatalog ,
albumParam : Param.albumParam ,
onSuccess : function ( ret ) {
tips.success( ret.msg );
if ( ret.code == 0 ) {
setImgPreview.set( 'icon' , ret.data.savePath );
}
} ,
onChooseAlbum : function ( uri ) {
setImgPreview.set( 'icon' , uri );
}
} );
//密码重置
$( document ).on( 'click' , '.reset-pwd-btn' , function ( e ) {
e.preventDefault();
var id = $( this ).data( 'id' );
sure.init( '将密码重置为 ' + Param.defaultPwd + " ?" , function () {
$.get( Param.uri.resetPwd + '/'+id , function ( ret ) {
if ( ret.code != 0 ) {
tips.error( ret.msg );
return;
}
tips.success( '重置成功' );
} );
} );
} );
} ,
delData : function ( ids ) {
var data = {
ids : ids,
_token : this.token
};
sure.init( '是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function ( res ) {
tips( res.responseText );
} )
.done( function ( res ) {
if ( res.code == 401 ) {
//需要登录
tips.error( '请先登录' );
} else if ( res.code != 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
}
} );
} );
} ,
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param( Param.query );
history.replaceState( Param.query , '' , uri );
//console.log( uri );
$( '#dataGrid' ).TableGrid( {
uri : Param.uri.read ,
selectAll : false ,
param : Param.query ,
rowStyle : function ( row ) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var old_uri = window.location.href;
var uri = Param.uri.this + '?' + $.param( settings.param );
if ( old_uri == uri ) {
return false;
}
var params = $.getUrlParams( window.location.href );
history.pushState( params , '' , old_uri );
history.replaceState( settings.param , '' , uri );
}
} );
}
};
//pop state 事件
window.onpopstate = function ( event ) {
if ( event && event.state ) {
$( '#searchForm' ).reloadForm( event.state );
var $dataGrid = $( '#data_grid' );
$dataGrid.TableGrid( 'setParam' , event.state );
$dataGrid.TableGrid( 'reload' );
}
};
var formatUsername = function ( value , row ) {
var html = value + '<br>';
$.each( row.roles , function ( index , role ) {
html += '<span class="label label-default label-sm">' + role.role_name + '</span>';
} );
return html;
};
var optResetPwd = function ( value , row ) {
return '<a href="#" data-id="' + row.id + '" class="btn default btn-sm reset-pwd-btn">' +
'<i class="fa fa-key"></i> 重置密码</a>';
};
================================================
FILE: resources/assets/static/js/backend/MerUser.js
================================================
/**
* MerUser JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-27
*/
var MerUser = {
token: $('input[name=_token]').val(),
init: function() {
//重新设置菜单
if (!empty(Param.uri.menu)) {
Layout.setSidebarMenuActiveLink('set', 'a[data-uri="' + Param.uri.menu + '"]');
}
//初始化ajax 提示框
loading.initAjax();
this.initBtn();
this.initSearchForm();
this.initGrid();
},
//初始化查询form
initSearchForm: function() {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//点击查询按钮
$('#searchBtn').on('click', function(e) {
e.preventDefault();
var $dataGrid = $('#dataGrid');
var param = $dataGrid.TableGrid('getParam');
param.keyword = $.trim($('#keyword').val());
param.status = $('#status').val();
param.module = $('#module').val();
param.page = 1;
//console.log( param );
$dataGrid.TableGrid('setParam', param);
$dataGrid.TableGrid('reload');
});
},
//显示 portlet
setPortletShow: function(type) {
var $tablePortlet = $('#tablePortlet');
var $addEditPortlet = $('#addEditPortlet');
$tablePortlet.slideUp('fast');
if (type == 'add') {
if (!$addEditPortlet.hasClass('red')) {
$addEditPortlet.removeClass('green-meadow').addClass('red');
}
$addEditPortlet.find('.caption-title').html('新建' + Param.pageTitle);
} else if (type == 'edit') {
if (!$addEditPortlet.hasClass('green-meadow')) {
$addEditPortlet.removeClass('red').addClass('green-meadow');
}
$addEditPortlet.find('.caption-title').html('编辑' + Param.pageTitle);
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
},
//关闭 portlet
setPortletHide: function() {
$('#tablePortlet').slideDown('fast');
$('#addEditPortlet').slideUp('fast');
},
//初始化各种按钮
initBtn: function() {
var self = this;
//打开添加框
$('#addNewBtn').on('click', function(e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm(Param.defaultRow);
setImgPreview.clear('icon');
$form.attr('action', Param.uri.insert);
});
//编辑按钮
$(document).on('click', '.editBtn', function(e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#dataGrid').TableGrid('getRow', id);
var $form = $('#addEditForm');
data = {
module: row.module
}
$('#roleForm').empty()
//设置角色组
$.get(Param.uri.merRoleRead, data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code != 0) {
tips.error(res.msg);
}
data = res.data.rows
$.each(data, function(index, value) {
label = '<label class="checkbox-inline"><input name="roles[]" type="checkbox" value="' + value.id + '">' + value.name + '</label>';
$('#roleForm').append(label)
})
});
$form.reloadForm(row);
setImgPreview.set('icon', row.icon);
//console.log(row.roles);
$.each(row.roles, function(index, item) {
$('input[name="roles[]"][value="' + item.role_id + '"]').prop('checked', true);
});
$form.attr('action', Param.uri.update + '/' + row.id);
});
//删除一行
$(document).on('click', '.destroyBtn', function(e) {
e.preventDefault();
var id = $(this).data('id');
self.delData(id);
});
$('#destroySelectBtn').on('click', function(e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if (empty(ids)) {
tips.error('请选择要删除的记录');
return;
}
self.delData(ids);
});
//提交添加编辑窗
$('#submitFormBtn').on('click', function(e) {
e.preventDefault();
var $form = $('#addEditForm');
if ($form.validForm()) {
var data = $form.serializeObject();
data._token = self.token;
$.post($form.attr('action'), data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 401) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#dataGrid').TableGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click', function(e) {
e.preventDefault();
self.setPortletHide();
});
//上传按钮
$('#iconUploadBtn').Uploader({
uri: Param.uri.upload, //上传文件
param: Param.uploadParam,
album: true,
albumUri: Param.uri.album,
albumCatalogUri: Param.uri.albumCatalog,
albumParam: Param.albumParam,
onSuccess: function(ret) {
tips.success(ret.msg);
if (ret.code == 0) {
setImgPreview.set('icon', ret.data.uri);
}
},
onChooseAlbum: function(uri) {
setImgPreview.set('icon', uri);
}
});
//密码重置
$(document).on('click', '.reset-pwd-btn', function(e) {
e.preventDefault();
var id = $(this).data('id');
sure.init('将密码重置为 ' + Param.defaultPwd + " ?", function() {
$.get(Param.uri.resetPwd + '/' + id, function(ret) {
if (ret.code != 0) {
tips.error(ret.msg);
return;
}
tips.success('重置成功');
});
});
});
},
delData: function(ids) {
var data = {
ids: ids,
_token: this.token
};
sure.init('是否删除?', function() {
$.post(Param.uri.destroy, data)
.fail(function(res) {
tips(res.responseText);
})
.done(function(res) {
if (res.code == 401) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#dataGrid').TableGrid('reload');
}
});
});
},
//初始化grid
initGrid: function() {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query, '', uri);
//console.log( uri );
$('#dataGrid').TableGrid({
uri: Param.uri.read,
selectAll: false,
param: Param.query,
rowStyle: function(row) {
if (row.status == 0) {
return 'warning';
}
},
loadSuccess: function(rows, settings) {
var old_uri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if (old_uri == uri) {
return false;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params, '', old_uri);
history.replaceState(settings.param, '', uri);
}
});
}
};
//pop state 事件
window.onpopstate = function(event) {
if (event && event.state) {
$('#searchForm').reloadForm(event.state);
var $dataGrid = $('#data_grid');
$dataGrid.TableGrid('setParam', event.state);
$dataGrid.TableGrid('reload');
}
};
var formatUsername = function(value, row) {
var html = value + '<br>';
$.each(row.roles, function(index, role) {
html += '<span class="badge badge-default ">' + role.role_name + '</span>';
});
return html;
};
var optResetPwd = function(value, row) {
return '<a href="#" data-id="' + row.id + '" class="btn default btn-sm reset-pwd-btn">' +
'<i class="fa fa-key"></i> 重置密码</a>';
};
var formatTest = function(value) {
var data = ['否', '是'];
return '<span class="label label-sm label-' + yesColor[value] + '">' + data[value] + '</span>';
};
================================================
FILE: resources/assets/static/js/backend/MerUserFavorites.js
================================================
/**
* MerUserFavorites JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-21
*/
var MerUserFavorites = {
config : {} ,
init : function () {
//重新设置菜单
if ( !empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink('set' , 'a[data-uri="'+ Param.uri.menu +'"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click' , function (e) {
e.preventDefault();
var $dataGrid = $('#dataGrid');
var param = $dataGrid.TableGrid('getParam');
param = $.extend({} , param , $('#searchForm').serializeObject() );
param.page = 1;
$dataGrid.TableGrid('setParam' , param);
$dataGrid.TableGrid('reload');
});
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $('#tablePortlet') ;
var $addEditPortlet = $('#addEditPortlet');
$tablePortlet.slideUp('fast');
if ( type == 'add' ) {
if ( !$addEditPortlet.hasClass('blue') ) {
$addEditPortlet.removeClass('green-meadow').addClass('blue');
}
$addEditPortlet.find('.caption-subject').html('新增 ' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( !$addEditPortlet.hasClass('green-meadow') ) {
$addEditPortlet.removeClass('blue').addClass('green-meadow');
}
$addEditPortlet.find('.caption-subject').html('编辑 ' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
},
//关闭 portlet
setPortletHide : function () {
$('#tablePortlet').slideDown('fast') ;
$('#addEditPortlet').slideUp('fast');
},
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$('#addNewBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm( Param.defaultRow );
$form.attr('action' , Param.uri.insert );
});
//编辑按钮
$(document).on('click' , '.editBtn' , function (e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#dataGrid').TableGrid('getRow' , id);
var $form = $('#addEditForm');
$form.reloadForm( row );
$form.attr('action' , Param.uri.update + row.id );
});
//删除一行
$(document).on('click' , '.destroyBtn' , function (e) {
e.preventDefault();
var id = $(this).data('id');
self.delData( id );
});
$('#destroySelectBtn').on('click' , function (e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error('请选择要删除的记录');
return ;
}
self.delData( ids );
});
//提交添加编辑窗
$('#submitFormBtn').on('click' , function (e) {
e.preventDefault();
var $form = $('#addEditForm');
if( $form.validForm() ) {
var data = $form.serializeObject();
$.post( $form.attr('action') , data )
.fail( function(res){
tips.error( res.responseText );
})
.done( function( res ){
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletHide();
});
} ,
delData : function ( ids ) {
var self = this ;
var data = {
ids : ids
};
sure.init('是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function(res){
tips.error( res.responseText );
})
.done(function (res) {
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
}
});
});
},
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query , '' , uri);
$('#dataGrid').TableGrid({
uri : Param.uri.read ,
selectAll : true ,
param : Param.query ,
rowStyle : function (row) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if ( oldUri == uri) {
return false ;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params , '' , oldUri);
history.replaceState(settings.param , '' , uri);
}
});
}
};
//pop state 事件
window.onpopstate = function (event) {
if ( event && event.state ) {
$('#searchForm').reloadForm( event.state );
var $dataGrid = $('#dataGrid');
$dataGrid.TableGrid('setParam' , event.state);
$dataGrid.TableGrid('reload');
}
};
================================================
FILE: resources/assets/static/js/backend/Simulator.js
================================================
/**
* 接口调试 JS
*
* @author Zix
* @version 2.0 , 2016-09-13
*/
var Simulator = {
config : {
arrayCount : 0 ,
method : ''
} ,
init : function ( config ) {
var self = this;
$.extend( this.config , config );
self.initApiUri();
self.initBtn();
self.initVersion();
} ,
initVersion: function(){
var ret = {"v1":[{"version":"v1","text":"v1"}],"v2":[{"version":"v2","text":"v2"}]}
var options = [];
for(var version in ret){
if(! ret.hasOwnProperty(version)){
continue;
}
var item = ret[ version ];
console.log(item)
options.push( '<optgroup label="' + version + '">' );
if ( ret[ version ].length > 0 ) {
for ( var i in item ) {
if ( ! item.hasOwnProperty( i ) ) {
continue;
}
var row = item[ i ];
options.push( '<option value="' + row.version + '" data-directory="' + row.text + '">' + row.version + '/' + ' (' + row.text + ')' + '</option>' );
}
}
options.push( '</optgroup>' );
}
$( '#version' ).html( options.join( '' ) ).eq( 0 ).prop( 'selected' , true );
},
//初始化action
initApiUri : function (version='') {
self=this;
$.get( Param.uri.readApi+"?version="+version , function ( ret ) {
//console.log( ret ) ;
var options = [];
for ( var name in ret ) {
if ( ! ret.hasOwnProperty( name ) ) {
continue;
}
var item = ret[ name ];
options.push( '<optgroup label="' + name + '">' );
if ( ret[ name ].length > 0 ) {
for ( var i in item ) {
if ( ! item.hasOwnProperty( i ) ) {
continue;
}
var row = item[ i ];
options.push( '<option value="' + row.action + '" data-directory="' + row.directory + '">' +
row.directory + '/' + row.action + ' (' + row.text + ')' + '</option>' );
}
}
options.push( '</optgroup>' );
}
$( '#actions' ).html( options.join( '' ) ).eq( 0 ).prop( 'selected' , true );
self.loadParams();
} );
} ,
//初始化按钮
initBtn : function () {
var self = this;
var $actions = $( '#actions' );
var $headerForm = $( '#headerForm' );
var $signatureStr = $( '#signatureStr' );
var $apiResponse = $( '#apiResponse' );
var $version = $('#version');
//显示隐藏header
$( '#showOrHideHeader' ).on( 'click' , function ( e ) {
e.preventDefault();
console.log( $headerForm.is( ':hidden' ) );
if ( $headerForm.is( ':hidden' ) ) {
$headerForm.show();
$( this ).removeClass( 'green' ).addClass( 'grey' ).text( '隐藏' );
} else {
$headerForm.hide();
$( this ).removeClass( 'grey' ).addClass( 'green' ).text( '显示' );
}
} );
$version.on('change' , function(){
var $version = $('#version');
//version
$ver = $version.find('option:selected').data( 'directory' )
self.initApiUri($ver)
});
//action变化
$actions.on( 'change' , function () {
self.config.method = '';
$( '#selectActionBtn' ).trigger( 'click' );
} );
//选择action
$( '#selectActionBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.config.method = '';
self.loadParams();
} );
//选择method
$( document ).on( 'click' , 'input[name="requestMethod"]' , function () {
var method = $( this ).val();
if ( self.config.method == method ) {
return false;
}
console.log( method );
self.config.method = method;
self.loadParams();
} );
//发送请求
$( document ).on( 'click' , '#submitBtn' , function ( e ) {
e.preventDefault();
loading.start();
var apiUri = Param.uri.api+self.config.version+'/' + self.config.directory + '/' + self.config.action;
//时间戳
var timestamp = Date.parse( new Date() ) / 1000;
//头部固定参数
var header = $( '#headerForm' ).serializeObject();
header[ 'timestamp' ] = timestamp;
$( '#timestamp' ).val( timestamp );
//要传的参数
var params = self.fixFormData( $( '#paramsForm' ).serializeJSON() );
//请求方式
var requestMethod = $( 'input[name="requestMethod"]:checked' ).val();
//计算签名
header[ 'signature' ] = signature( params , timestamp , Param.secret );
$( '#signatureInp' ).val( header[ 'signature' ] );
if ( self.config.directory == 'system' && self.config.action == 'upload' ) {
//上传文件
FileUpload.send( Param.uri.api + 'system/upload' , header , params , function ( ret ) {
$apiResponse.show().html( jsonFormat( ret ) );
} );
} else {
//普通请求
$.ajax( {
type : requestMethod ,
dataType : 'json' ,
url : apiUri ,
data : params ,
headers : header
} )
.fail( function ( res ) {
loading.end();
$apiResponse.show().html( '发生错误了' + res.responseText );
} )
.done( function ( res ) {
loading.end();
$apiResponse.show().html( jsonFormat( res ) );
} );
}
} );
//显示返回示例
$( document ).on( 'click' , '#responseBtn' , function ( e ) {
e.preventDefault();
var $responseExample = $( '#responseExample' );
if ( $responseExample.is( ':hidden' ) ) {
var result = $responseExample.data( 'json' );
$responseExample.show().find( 'pre' ).html( JSON.stringify( result , null , 2 ) );
} else {
$responseExample.hide();
}
} );
//添加 array item 按钮
$( document ).on( 'click' , '.addMoreBtn' , function ( e ) {
e.preventDefault();
var $row = $( this ).parent().parent();
self.config.arrayCount ++;
var rowHtml = $row.find( '.for_copy' ).html().replace( /0/g , self.config.arrayCount );
var html = '<div class="row">' + rowHtml +
'<div class="col-sm-4"><button class="btn btn-default removeRowBtn"><i class="fa fa-minus"></i></button>' +
'</div></div>';
$row.after( html );
} );
//删除 array item 按钮
$( document ).on( 'click' , '.removeRowBtn' , function ( e ) {
e.preventDefault();
$( this ).parent().parent().remove();
} )
} ,
//加载参数
loadParams : function () {
var self = this;
var $actions = $( '#actions' );
var $signatureStr = $( '#signatureStr' );
var $apiResponse = $( '#apiResponse' );
var $version = $('#version');
//version
$ver = $version.find('option:selected').data( 'directory' )
self.config.arrayCount = 0;
self.config.directory = $actions.find( 'option:selected' ).data( 'directory' );
self.config.action = $actions.val();
self.config.version = $ver
var data = {
directory : self.config.directory ,
action : self.config.action ,
method : self.config.method,
version : self.config.version
};
loading.start();
$signatureStr.html( '' );
$apiResponse.html( '' );
$.get( Param.uri.readParams , data , function ( res ) {
loading.end();
$( '#params' ).html( res );
//$('input[name="requestMethod"]:first').prop('checked' , true);
self.addTestData();
} );
} ,
addTestData : function () {
var $form = $( '#paramsForm' );
var $token = $form.find( 'input[name="api_token"]' );
var $merId = $form.find( 'input[name="merId"]' );
var html = '';
console.log($token);
if ( $token.length > 0 ) {
html = '<select name="api_token" class="form-control">';
for ( var i = 0 ; i < Param.testToken.length ; i ++ ) {
var user = Param.testToken[ i ];
html += '<option value="' + user.api_token + '">' + user.api_token + ' (' + user.username + ' - ' + user.phone + ' )' + '</option>';
}
html += '</select>';
$token.after( html );
$token.remove();
}
if ( $merId.length > 0 ) {
html = '<select name="merId" class="form-control">';
for ( var i = 0 ; i < Param.testMer.length ; i ++ ) {
var mer = Param.testMer[ i ];
html += '<option value="' + mer.id + '">' + mer.id + ' (' + mer.name + ')' + '</option>';
}
html += '</select>';
$merId.after( html );
$merId.remove();
}
} ,
fixFormData : function ( data ) {
//console.log( data ) ;
for ( var key in data ) {
if ( ! data.hasOwnProperty( key ) ) {
continue;
}
if ( $.isArray( data[ key ] ) || $.isPlainObject( data[ key ] ) ) {
var newArr = [];
for ( var k in data[ key ] ) {
if ( ! data[ key ].hasOwnProperty( k ) ) {
continue;
}
if ( ! empty( data[ key ][ k ] ) ) {
newArr.push( data[ key ][ k ] )
}
}
data[ key ] = JSON.stringify( newArr );
}
}
return data;
}
};
//签名
function signature( data , timestamp , secret ) {
//data['timestamp'] = timestamp ;
var metadata = [];
for ( var name in data ) {
if ( ! data.hasOwnProperty( name ) ) {
continue;
}
var value = data[ name ];
if ( $.isFunction( value ) ) {
continue;
}
metadata.push( {
name : name ,
value : value
} )
}
metadata.push( {
name : 'timestamp' ,
value : timestamp
} );
metadata.sort( function ( a , b ) {
return a.name < b.name ? - 1 : 1;
} );
var url = [];
for ( var i in metadata ) {
if ( typeof (metadata[ i ][ 'value' ]) === 'undefined' ) {
continue;
}
url.push( metadata[ i ][ 'name' ] + '=' + metadata[ i ][ 'value' ] );
}
url = url.join( '&' , url ) + '&secret=' + secret;
$( '#signatureStr' ).html( htmlEncode( url ) );
return $.md5( url );
}
var htmlEncode = function ( str ) {
var s = "";
s = str.replace( /&/g , "&" );
return s;
};
var FileUpload = {
config : {
callback : function () {
}
} ,
send : function ( url , header , params , callback ) {
var self = this;
self.config.callback = callback;
var file = $( 'input[name="fileData"]' )[ 0 ].files[ 0 ];
var fd = new FormData();
fd.append( "fileData" , file );
var xhr = new XMLHttpRequest();
for ( var key in params ) {
if ( ! params.hasOwnProperty( key ) ) {
continue;
}
if ( ! params[ key ] ) {
continue;
}
fd.append( key , params[ key ] );
}
xhr.upload.addEventListener( "progress" , self.onProgress , false );
xhr.addEventListener( "load" , self.onComplete , false );
xhr.addEventListener( "error" , self.onFailed , false );
xhr.addEventListener( "abort" , self.onCanceled , false );
xhr.open( "POST" , url );
for ( var k in header ) {
if ( ! header.hasOwnProperty( k ) ) {
continue;
}
xhr.setRequestHeader( k , header[ k ] );
}
xhr.send( fd );
} ,
onComplete : function ( e ) {
loading.end();
try {
var jsonData = $.parseJSON( e.target.responseText );
FileUpload.config.callback( jsonData );
} catch ( e ) {
FileUpload.config.callback( e.message );
}
} ,
onProgress : function ( e ) {
if ( e.lengthComputable ) {
//console.log( e.loaded + ' - ' + e.total );
} else {
FileUpload.config.callback( e.message );
}
} ,
onFailed : function ( e ) {
loading.end();
FileUpload.config.callback( e.message );
} ,
onCanceled : function ( e ) {
loading.end();
FileUpload.config.callback( e.message );
}
};
/**
* json 格式化
*/
function jsonFormat( txt , compress ) {
if ( ! txt ) {
return txt;
}
var indentChar = ' ';
if ( /^\s*$/.test( txt ) ) {
//alert('数据为空,无法格式化! ');
return txt;
}
var data = txt;
if ( ! $.isPlainObject( data ) ) {
try {
data = eval( '(' + txt + ')' );
} catch ( e ) {
//alert('数据源语法错误,格式化失败! 错误信息: ' + e.description, 'err');
return txt;
}
}
var draw = [] ,
last = false ,
This = this ,
line = compress ? '' : '\n' ,
nodeCount = 0 ,
maxDepth = 0;
var notify = function ( name , value , isLast , indent /* 缩进 */ , formObj ) {
nodeCount ++;
/* 节点计数 */
for ( var i = 0 , tab = '' ; i < indent ; i ++ ) {
tab += indentChar;
}
/* 缩进HTML */
tab = compress ? '' : tab;
/* 压缩模式忽略缩进 */
maxDepth = ++ indent;
/* 缩进递增并记录 */
if ( value && value.constructor == Array ) { /* 处理数组 */
draw.push( tab + (
formObj ? (
'"' + name + '":'
) : ''
) + '[' + line );
/*
* 缩进'['
* 然后换行
*/
for ( var i = 0 ; i < value.length ; i ++ ) {
notify( i , value[ i ] , i == value.length - 1 , indent , false );
}
draw.push( tab + ']' + (
isLast ? line : (
',' + line
)
) );
/* 缩进']'换行,若非尾元素则添加逗号 */
} else if ( value && typeof value == 'object' ) { /* 处理对象 */
draw.push( tab + (
formObj ? (
'"' + name + '":'
) : ''
) + '{' + line );
/*
* 缩进'{'
* 然后换行
*/
var len = 0 ,
i = 0;
for ( var key in value ) {
len ++;
}
for ( var key in value ) {
notify( key , value[ key ] , ++ i == len , indent , true );
}
draw.push( tab + '}' + (
isLast ? line : (
',' + line
)
) );
/* 缩进'}'换行,若非尾元素则添加逗号 */
} else {
if ( typeof value == 'string' ) {
value = '"' + value + '"';
}
draw.push( tab + (
formObj ? (
'"' + name + '":'
) : ''
) + value + (
isLast ? '' : ','
) + line );
}
;
};
var isLast = true ,
indent = 0;
notify( '' , data , isLast , indent , false );
return draw.join( '' );
}
================================================
FILE: resources/assets/static/js/backend/SimulatorReadme.js
================================================
/**
* 模拟器文档 JS
*
* @author Zix
* @version 2.0 , 2016-05-06
*/
var SimulatorReadme = {
init : function () {
var self = this;
//重新设置菜单
if ( ! empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink( 'set' , 'a[data-uri="' + Param.uri.menu + '"]' );
}
}
};
================================================
FILE: resources/assets/static/js/backend/SysApiLog.js
================================================
/**
* SysApiLog JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2017-09-25
*/
var {funcLower} = {
token : $('input[name=_token]').val(),
config : {} ,
init : function () {
//重新设置菜单
if ( !empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink('set' , 'a[data-uri="'+ Param.uri.menu +'"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click' , function (e) {
e.preventDefault();
var $dataGrid = $('#dataGrid');
var param = $dataGrid.TableGrid('getParam');
param = $.extend({} , param , $('#searchForm').serializeObject() );
param.page = 1;
$dataGrid.TableGrid('setParam' , param);
$dataGrid.TableGrid('reload');
});
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $('#tablePortlet') ;
var $addEditPortlet = $('#addEditPortlet');
$tablePortlet.slideUp('fast');
if ( type == 'add' ) {
if ( !$addEditPortlet.hasClass('blue') ) {
$addEditPortlet.removeClass('green-meadow').addClass('blue');
}
$addEditPortlet.find('.caption-subject').html('新增 ' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( !$addEditPortlet.hasClass('green-meadow') ) {
$addEditPortlet.removeClass('blue').addClass('green-meadow');
}
$addEditPortlet.find('.caption-subject').html('编辑 ' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
},
//关闭 portlet
setPortletHide : function () {
$('#tablePortlet').slideDown('fast') ;
$('#addEditPortlet').slideUp('fast');
},
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$('#addNewBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm( Param.defaultRow );
$form.attr('action' , Param.uri.insert );
});
//编辑按钮
$(document).on('click' , '.editBtn' , function (e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#dataGrid').TableGrid('getRow' , id);
var $form = $('#addEditForm');
$form.reloadForm( row );
$form.attr('action' , Param.uri.update + '/' +row.id );
});
//删除一行
$(document).on('click' , '.destroyBtn' , function (e) {
e.preventDefault();
var id = $(this).data('id');
self.delData( id );
});
$('#destroySelectBtn').on('click' , function (e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error('请选择要删除的记录');
return ;
}
self.delData( ids );
});
//提交添加编辑窗
$('#submitFormBtn').on('click' , function (e) {
e.preventDefault();
var $form = $('#addEditForm');
if( $form.validForm() ) {
var data = $form.serializeObject();
$.post( $form.attr('action') , data )
.fail( function(res){
tips.error( res.responseText );
})
.done( function( res ){
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletHide();
});
} ,
delData : function ( ids ) {
var self = this ;
var data = {
ids : ids,
_token : this.token
};
sure.init('是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function(res){
tips.error( res.responseText );
})
.done(function (res) {
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if( res.code != 0 ){
tips.error( res.msg );
} else {
tips.success( res.msg );
$('#dataGrid').TableGrid('reload');
}
});
});
},
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query , '' , uri);
$('#dataGrid').TableGrid({
uri : Param.uri.read ,
selectAll : true ,
param : Param.query ,
rowStyle : function (row) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if ( oldUri == uri) {
return false ;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params , '' , oldUri);
history.replaceState(settings.param , '' , uri);
}
});
}
};
//pop state 事件
window.onpopstate = function (event) {
if ( event && event.state ) {
$('#searchForm').reloadForm( event.state );
var $dataGrid = $('#dataGrid');
$dataGrid.TableGrid('setParam' , event.state);
$dataGrid.TableGrid('reload');
}
};
================================================
FILE: resources/assets/static/js/backend/SysAppVersion.js
================================================
/**
* SysAppVersion JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-27
*/
var SysAppVersion = {
token : $('input[name=_token]').val(),
config : {} ,
init : function () {
//重新设置菜单
if ( ! empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink( 'set' , 'a[data-uri="' + Param.uri.menu + '"]' );
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $( '#searchForm' );
$searchForm.reloadForm( Param.query );
//查询按钮
$( '#searchBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $dataGrid = $( '#dataGrid' );
var param = $dataGrid.TableGrid( 'getParam' );
param = $.extend( {} , param , $( '#searchForm' ).serializeObject() );
param.page = 1;
$dataGrid.TableGrid( 'setParam' , param );
$dataGrid.TableGrid( 'reload' );
} );
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $( '#tablePortlet' );
var $addEditPortlet = $( '#addEditPortlet' );
$tablePortlet.slideUp( 'fast' );
if ( type == 'add' ) {
if ( ! $addEditPortlet.hasClass( 'blue' ) ) {
$addEditPortlet.removeClass( 'green-meadow' ).addClass( 'blue' );
}
$addEditPortlet.find( '.caption-subject' ).html( '新增 ' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( ! $addEditPortlet.hasClass( 'green-meadow' ) ) {
$addEditPortlet.removeClass( 'blue' ).addClass( 'green-meadow' );
}
$addEditPortlet.find( '.caption-subject' ).html( '编辑 ' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
} ,
//关闭 portlet
setPortletHide : function () {
$( '#tablePortlet' ).slideDown( 'fast' );
$( '#addEditPortlet' ).slideUp( 'fast' );
} ,
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$( '#addNewBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'add' );
var $form = $( '#addEditForm' );
$form.reloadForm( Param.defaultRow );
$form.attr( 'action' , Param.uri.insert );
} );
//编辑按钮
$( document ).on( 'click' , '.editBtn' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'edit' );
var id = $( this ).data( 'id' );
var row = $( '#dataGrid' ).TableGrid( 'getRow' , id );
var $form = $( '#addEditForm' );
$form.reloadForm( row );
$form.attr( 'action' , Param.uri.update + '/'+ row.id );
} );
//删除一行
$( document ).on( 'click' , '.destroyBtn' , function ( e ) {
e.preventDefault();
var id = $( this ).data( 'id' );
self.delData( id );
} );
$( '#destroySelectBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var ids = $( '.checker:checked' ).serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error( '请选择要删除的记录' );
return;
}
self.delData( ids );
} );
//提交添加编辑窗
$( '#submitFormBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $form = $( '#addEditForm' );
if ( $form.validForm() ) {
var data = $form.serializeObject();
data._token = self.token;
$.post( $form.attr( 'action' ) , data )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code == 1001 ) {
//需要登录
tips.error( '请先登录' );
} else if ( res.code != 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
self.setPortletHide();
}
} );
}
} );
//关闭添加编辑窗
$( '#closePortletBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletHide();
} );
} ,
delData : function ( ids ) {
var self = this;
var data = {
ids : ids,
_token : this.token
};
sure.init( '是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code == 1001 ) {
//需要登录
tips.error( '请先登录' );
} else if ( res.code != 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
}
} );
} );
} ,
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param( Param.query );
history.replaceState( Param.query , '' , uri );
$( '#dataGrid' ).TableGrid( {
uri : Param.uri.read ,
selectAll : true ,
param : Param.query ,
rowStyle : function ( row ) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param( settings.param );
//console.log( uri );
if ( oldUri == uri ) {
return false;
}
var params = $.getUrlParams( window.location.href );
history.pushState( params , '' , oldUri );
history.replaceState( settings.param , '' , uri );
}
} );
}
};
//pop state 事件
window.onpopstate = function ( event ) {
if ( event && event.state ) {
$( '#searchForm' ).reloadForm( event.state );
var $dataGrid = $( '#dataGrid' );
$dataGrid.TableGrid( 'setParam' , event.state );
$dataGrid.TableGrid( 'reload' );
}
};
var formatDevice = function ( value ) {
if ( value == 'ios' ) {
return '<i class="fa fa-apple"></i>'
} else {
return '<i class="fa fa-android"></i>';
}
};
var formatUri = function ( value ) {
if ( empty( value ) ) {
return '';
}
return '<a href="' + value + '">下载</a>';
};
================================================
FILE: resources/assets/static/js/backend/SysArea.js
================================================
/**
* SysArea JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-20
*/
var SysArea = {
token : $('input[name=_token]').val(),
config : {} ,
init : function () {
//重新设置菜单
if ( ! empty(Param.uri.menu) ) {
Layout.setSidebarMenuActiveLink('set' , 'a[data-uri="' + Param.uri.menu + '"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $('#searchForm');
$searchForm.reloadForm(Param.query);
//查询按钮
$('#searchBtn').on('click' , function (e) {
e.preventDefault();
var $dataGrid = $('#dataGrid');
var param = $dataGrid.TableGrid('getParam');
param = $.extend({} , param , $('#searchForm').serializeObject());
param.page = 1;
$dataGrid.TableGrid('setParam' , param);
$dataGrid.TableGrid('reload');
});
} ,
//显示 modal
setPortletShow : function (type) {
var $addEditModal = $('#addEditModal');
$addEditModal.modal('show');
if ( type == 'add' ) {
$addEditModal.find('.caption-subject').html('新增 ' + Param.pageTitle);
} else if ( type == 'edit' ) {
$addEditModal.find('.caption-subject').html('编辑 ' + Param.pageTitle);
}
} ,
//关闭 modal
setPortletHide : function () {
$('#addEditModal').modal('hide');
} ,
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$('#addNewBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm(Param.defaultRow);
$form.attr('action' , Param.uri.insert);
});
//编辑按钮
$(document).on('click' , '.editBtn' , function (e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#dataGrid').TableGrid('getRow' , id);
var $form = $('#addEditForm');
$form.reloadForm(row);
$form.attr('action' , Param.uri.update+ '/' + row.id);
});
//删除一行
$(document).on('click' , '.destroyBtn' , function (e) {
e.preventDefault();
var id = $(this).data('id');
self.delData(id);
});
$('#destroySelectBtn').on('click' , function (e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if ( empty(ids) ) {
tips.error('请选择要删除的记录');
return;
}
self.delData(ids);
});
//提交添加编辑窗
$('#submitFormBtn').on('click' , function (e) {
e.preventDefault();
var $form = $('#addEditForm');
if ( $form.validForm() ) {
var data = $form.serializeObject();
data['pid'] = Param.query.pid;
$.post($form.attr('action') , data)
.fail(function (res) {
tips.error(res.responseText);
})
.done(function (res) {
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if ( res.code != 0 ) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#dataGrid').TableGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click' , function (e) {
e.preventDefault();
self.setPortletHide();
});
} ,
delData : function (ids) {
var self = this;
var data = {
ids : ids ,
_token : self.token
};
sure.init('是否删除?' , function () {
$.post(Param.uri.destroy , data)
.fail(function (res) {
tips.error(res.responseText);
})
.done(function (res) {
if ( res.code == 1001 ) {
//需要登录
tips.error('请先登录');
} else if ( res.code != 0 ) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#dataGrid').TableGrid('reload');
}
});
});
} ,
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query , '' , uri);
$('#dataGrid').TableGrid({
uri : Param.uri.read ,
selectAll : true ,
param : Param.query ,
rowStyle : function (row) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function (rows , settings) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if ( oldUri == uri ) {
return false;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params , '' , oldUri);
history.replaceState(settings.param , '' , uri);
}
});
}
};
//pop state 事件
window.onpopstate = function (event) {
if ( event && event.state ) {
$('#searchForm').reloadForm(event.state);
var $dataGrid = $('#dataGrid');
$dataGrid.TableGrid('setParam' , event.state);
$dataGrid.TableGrid('reload');
}
};
var optChildren = function (value , row) {
return '<a href="backend/sysarea/index?pid=' + row.id + '" class="btn btn-sm grey">' +
'<i class="fa fa-arrow-down"></i> 查看下级</a>';
};
================================================
FILE: resources/assets/static/js/backend/SysFunc.js
================================================
/**
* SysFunc JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-12
*/
var SysFunc = {
'token': $('input[name=_token]').val(),
init: function() {
//重新设置菜单
if (!empty(Param.uri.menu)) {
Layout.setSidebarMenuActiveLink('set', 'a[data-uri="' + Param.uri.menu + '"]');
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化数据表
this.initGrid();
},
//显示 modal
setPortletShow: function(type) {
var $addEditModal = $('#addEditModal');
$addEditModal.modal('show');
if (type == 'add') {
$addEditModal.find('.caption-subject').html('新建' + Param.pageTitle);
} else if (type == 'edit') {
$addEditModal.find('.caption-subject').html('编辑' + Param.pageTitle);
}
},
//关闭 modal
setPortletHide: function() {
$('#addEditModal').modal('hide');
},
//初始化各种按钮
initBtn: function() {
var self = this;
//打开添加框
$('#addNewBtn').on('click', function(e) {
e.preventDefault();
self.setPortletShow('add');
var $form = $('#addEditForm');
$form.reloadForm(Param.defaultRow);
$form.attr('action', Param.uri.insert);
});
//编辑按钮
$(document).on('click', '.editBtn', function(e) {
e.preventDefault();
self.setPortletShow('edit');
var id = $(this).data('id');
var row = $('#treeGrid').TreeGrid('getRow', id);
var $form = $('#addEditForm');
$form.reloadForm(row);
$form.attr('action', Param.uri.update + '/' + row.id);
});
//删除一行
$(document).on('click', '.destroyBtn', function(e) {
e.preventDefault();
var id = $(this).data('id');
self.delData(id);
});
$('#destroySelectBtn').on('click', function(e) {
e.preventDefault();
var ids = $('.checker:checked').serializeJSON().selectChecker;
if (empty(ids)) {
tips.error('请选择要删除的记录');
return;
}
self.delData(ids);
});
//提交添加编辑窗
$('#submitFormBtn').on('click', function(e) {
e.preventDefault();
var $form = $('#addEditForm');
if ($form.validForm()) {
var data = $form.serializeObject();
$.post($form.attr('action'), data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 1001) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#treeGrid').TreeGrid('reload');
self.setPortletHide();
}
});
}
});
//关闭添加编辑窗
$('#closePortletBtn').on('click', function(e) {
e.preventDefault();
self.setPortletHide();
});
//打开权限窗口
$(document).on('click', '.privilegeBtn', function(e) {
e.preventDefault();
var id = $(this).data('id');
var data = $('#treeGrid').TreeGrid('getRow', id);
var privilege = data.privilege;
var $form = $('#privilegeForm');
$form[0].reset();
if (!empty(privilege)) {
$.each(privilege, function(index, item) {
$form.find('input[value="' + item.name + '"]').prop('checked', true);
});
}
$form.attr('action', Param.uri.updatePrivilege + '/' + id);
$('#privilegeModal').modal('show');
});
//更新权限
$('#submitPrivilegeFormBtn').on('click', function(e) {
e.preventDefault();
var $form = $('#privilegeForm');
var uri = $form.attr('action');
var data = $form.serializeObject();
$.post(uri, data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 403) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#treeGrid').TreeGrid('reload');
$('#privilegeModal').modal('hide');
}
});
})
},
delData: function(ids) {
var data = {
ids: ids,
_token: this.token
};
sure.init('是否删除?', function() {
$.post(Param.uri.destroy, data)
.fail(function(res) {
tips.error(res.responseText);
})
.done(function(res) {
if (res.code == 1001) {
//需要登录
tips.error('请先登录');
} else if (res.code != 0) {
tips.error(res.msg);
} else {
tips.success(res.msg);
$('#treeGrid').TreeGrid('reload');
}
});
});
},
//初始化tree grid
initGrid: function() {
var self = this;
var uri = Param.uri.this + '?' + $.param(Param.query);
history.replaceState(Param.query, '', uri);
$('#treeGrid').TreeGrid({
uri: Param.uri.read,
field: 'name', //显示箭头的字段
param: Param.query, //查询参数
expandAll: true,
rowStyle: function(row) {
if (row.status == 0) {
return 'warning';
}
},
loadSuccess: function(rows, settings) {
var options = '<option value="0" selected>根目录</option>';
options += form_options_rows(rows, settings);
$('select[name="pid"]').html(options);
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param(settings.param);
if (oldUri == uri) {
return false;
}
var params = $.getUrlParams(window.location.href);
history.pushState(params, '', oldUri);
history.replaceState(settings.param, '', uri);
}
});
}
};
//pop state 事件
window.onpopstate = function(event) {
if (event && event.state) {
$('#searchForm').reloadForm(event.state);
var $treeGrid = $('#treeGrid');
$treeGrid.TreeGrid('setParam', event.state);
$treeGrid.TreeGrid('reload');
}
};
var formatName = function(value, row) {
var html = value;
if (!empty(row.icon)) {
html = '<i class="' + row.icon + '"></i> ' + html;
}
return html;
};
var formatIsFunc = function(value) {
return Param.isFunc[value];
};
var formatIsMenu = function(value) {
return Param.isMenu[value];
};
var optPrivilege = function(value, row) {
return '<a href="#" data-id="' + row.id + '" class="btn btn-sm blue privilegeBtn"><i class="fa fa-key"></i> 权限</a>';
};
================================================
FILE: resources/assets/static/js/backend/SysMail.js
================================================
/**
* SysMail JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-10-10
*/
var SysMail = {
token : $('input[name=_token]').val(),
config : {} ,
init : function () {
//重新设置菜单
if ( ! empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink( 'set' , 'a[data-uri="' + Param.uri.menu + '"]' );
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $( '#searchForm' );
$searchForm.reloadForm( Param.query );
//查询按钮
$( '#searchBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $dataGrid = $( '#dataGrid' );
var param = $dataGrid.TableGrid( 'getParam' );
param = $.extend( {} , param , $( '#searchForm' ).serializeObject() );
param.page = 1;
$dataGrid.TableGrid( 'setParam' , param );
$dataGrid.TableGrid( 'reload' );
} );
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $( '#tablePortlet' );
var $addEditPortlet = $( '#addEditPortlet' );
$tablePortlet.slideUp( 'fast' );
if ( type == 'add' ) {
if ( ! $addEditPortlet.hasClass( 'blue' ) ) {
$addEditPortlet.removeClass( 'green-meadow' ).addClass( 'blue' );
}
$addEditPortlet.find( '.caption-subject' ).html( '新增 ' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( ! $addEditPortlet.hasClass( 'green-meadow' ) ) {
$addEditPortlet.removeClass( 'blue' ).addClass( 'green-meadow' );
}
$addEditPortlet.find( '.caption-subject' ).html( '编辑 ' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
} ,
//关闭 portlet
setPortletHide : function () {
$( '#tablePortlet' ).slideDown( 'fast' );
$( '#addEditPortlet' ).slideUp( 'fast' );
} ,
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$( '#addNewBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'add' );
var $form = $( '#addEditForm' );
$form.reloadForm( Param.defaultRow );
$form.attr( 'action' , Param.uri.insert );
} );
//编辑按钮
$( document ).on( 'click' , '.editBtn' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'edit' );
var id = $( this ).data( 'id' );
var row = $( '#dataGrid' ).TableGrid( 'getRow' , id );
var $form = $( '#addEditForm' );
$form.reloadForm( row );
$form.attr( 'action' , Param.uri.update + '/' +row.id );
} );
//删除一行
$( document ).on( 'click' , '.destroyBtn' , function ( e ) {
e.preventDefault();
var id = $( this ).data( 'id' );
self.delData( id );
} );
$( '#destroySelectBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var ids = $( '.checker:checked' ).serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error( '请选择要删除的记录' );
return;
}
self.delData( ids );
} );
//提交添加编辑窗
$( '#submitFormBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $form = $( '#addEditForm' );
if ( $form.validForm() ) {
var data = $form.serializeObject();
data._token = self.token;
$.post( $form.attr( 'action' ) , data )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code == 1001 ) {
//需要登录
tips.error( '请先登录' );
} else if ( res.code != 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
self.setPortletHide();
}
} );
}
} );
//关闭添加编辑窗
$( '#closePortletBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletHide();
} );
//发送按钮
$( document ).on( 'click' , '.sendMailBtn' , function ( e ) {
e.preventDefault();
var data = {
id : $( this ).data( 'id' ) ,
_token : self.token
};
sure.init( '确定发送吗?' , function () {
$.post( Param.uri.send , data )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code != 0 ) {
tips.error( res.msg );
return false;
}
tips.success( res.msg );
} );
} );
} );
} ,
delData : function ( ids ) {
var self = this;
var data = {
ids : ids ,
_token : this.token
};
sure.init( '是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code == 1001 ) {
//需要登录
tips.error( '请先登录' );
} else if ( res.code != 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
}
} );
} );
} ,
//初始化grid
initGrid : function () {
var self = this;
var uri = Param.uri.this + '?' + $.param( Param.query );
history.replaceState( Param.query , '' , uri );
$( '#dataGrid' ).TableGrid( {
uri : Param.uri.read ,
selectAll : true ,
param : Param.query ,
rowStyle : function ( row ) {
if ( row.status == 0 ) {
return 'warning';
}
} ,
loadSuccess : function ( rows , settings ) {
var oldUri = window.location.href;
var uri = Param.uri.this + '?' + $.param( settings.param );
if ( oldUri == uri ) {
return false;
}
var params = $.getUrlParams( window.location.href );
history.pushState( params , '' , oldUri );
history.replaceState( settings.param , '' , uri );
}
} );
}
};
//pop state 事件
window.onpopstate = function ( event ) {
if ( event && event.state ) {
$( '#searchForm' ).reloadForm( event.state );
var $dataGrid = $( '#dataGrid' );
$dataGrid.TableGrid( 'setParam' , event.state );
$dataGrid.TableGrid( 'reload' );
}
};
var typeColor = { captcha : 'default' };
var formatType = function ( value ) {
return '<span class="label label-' + typeColor[ value ] + '">' + Param.type[ value ] + '</span>';
};
var optSend = function ( value , row ) {
var html = '';
if ( row.status == 0 ) {
html = '<a class="btn btn-sm blue sendMailBtn" data-id="' + row.id + '">' +
'<i class="fa fa-paper-plane"></i> 发送</a>';
}
return html;
};
================================================
FILE: resources/assets/static/js/backend/SysMerchant.js
================================================
/**
* SysMerchant JS
*
* @author MR.Z <zsh2088@gmail.com>
* @version 2.0 , 2016-09-13
*/
var SysMerchant = {
token : $('input[name=_token]').val(),
init : function () {
//重新设置菜单
if ( ! empty( Param.uri.menu ) ) {
Layout.setSidebarMenuActiveLink( 'set' , 'a[data-uri="' + Param.uri.menu + '"]' );
}
//初始化ajax 提示框
loading.initAjax();
//初始化页面按钮
this.initBtn();
//初始化查询form
this.initSearchForm();
//初始化数据表
this.initGrid();
} ,
//初始化查询form
initSearchForm : function () {
var $searchForm = $( '#searchForm' );
$searchForm.reloadForm( Param.query );
//查询按钮
$( '#searchBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $dataGrid = $( '#dataGrid' );
var param = $dataGrid.TableGrid( 'getParam' );
param = $.extend( {} , param , $( '#searchForm' ).serializeObject() );
param.page = 1;
$dataGrid.TableGrid( 'setParam' , param );
$dataGrid.TableGrid( 'reload' );
} );
} ,
//显示 portlet
setPortletShow : function ( type ) {
var $tablePortlet = $( '#tablePortlet' );
var $addEditPortlet = $( '#addEditPortlet' );
$tablePortlet.slideUp( 'fast' );
if ( type == 'add' ) {
if ( ! $addEditPortlet.hasClass( 'blue' ) ) {
$addEditPortlet.removeClass( 'green-meadow' ).addClass( 'blue' );
}
$addEditPortlet.find( '.caption-subject' ).html( '新建' + Param.pageTitle );
} else if ( type == 'edit' ) {
if ( ! $addEditPortlet.hasClass( 'green-meadow' ) ) {
$addEditPortlet.removeClass( 'blue' ).addClass( 'green-meadow' );
}
$addEditPortlet.find( '.caption-subject' ).html( '编辑' + Param.pageTitle );
}
//$('#data-table-portlet').slideUp('fast');
$addEditPortlet.show();
} ,
//关闭 portlet
setPortletHide : function () {
$( '#tablePortlet' ).slideDown( 'fast' );
$( '#addEditPortlet' ).slideUp( 'fast' );
} ,
//初始化各种按钮
initBtn : function () {
var self = this;
//打开添加框
$( '#addNewBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'add' );
var $form = $( '#addEditForm' );
$form.reloadForm( Param.defaultRow );
setImgPreview.clear( 'icon' );
$form.attr( 'action' , Param.uri.insert );
} );
//编辑按钮
$( document ).on( 'click' , '.editBtn' , function ( e ) {
e.preventDefault();
self.setPortletShow( 'edit' );
var id = $( this ).data( 'id' );
var row = $( '#dataGrid' ).TableGrid( 'getRow' , id );
var $form = $( '#addEditForm' );
$form.reloadForm( row );
setImgPreview.set( 'icon' , row.icon );
$( 'input[name="area"]' ).AreaSelection( 'setAreaName' , row.full_area_name );
$form.attr( 'action' , Param.uri.update + '/'+ row.id );
} );
//删除一行
$( document ).on( 'click' , '.destroyBtn' , function ( e ) {
e.preventDefault();
var id = $( this ).data( 'id' );
self.delData( id );
} );
$( '#destroySelectBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var ids = $( '.checker:checked' ).serializeJSON().selectChecker;
if ( empty( ids ) ) {
tips.error( '请选择要删除的记录' );
return;
}
self.delData( ids );
} );
//提交添加编辑窗
$( '#submitFormBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
var $form = $( '#addEditForm' );
if ( $form.validForm() ) {
var data = $form.serializeObject();
data._token = self.token;
$.post( $form.attr( 'action' ) , data )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code == 1001 ) {
//需要登录
tips.error( '请先登录' );
} else if ( res.code != 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
self.setPortletHide();
}
} );
}
} );
//关闭添加编辑窗
$( '#closePortletBtn' ).on( 'click' , function ( e ) {
e.preventDefault();
self.setPortletHide();
} );
//上传按钮
$( '#iconUploadBtn' ).Uploader( {
uri : Param.uri.upload , //上传文件
param : Param.uploadParam ,
album : true ,
albumUri : Param.uri.album ,
albumCatalogUri : Param.uri.albumCatalog ,
albumParam : Param.albumParam ,
onSuccess : function ( ret ) {
tips.success( ret.msg );
if ( ret.code == 0 ) {
setImgPreview.set( 'icon' , ret.data.savePath );
}
} ,
onChooseAlbum : function ( uri ) {
setImgPreview.set( 'icon' , uri );
}
} );
//创建系统用户
$( document ).on( 'click' , '.createSysUserBtn' , function ( e ) {
e.preventDefault();
var id = $( this ).data( 'id' );
var phone = $( this ).data( 'phone' );
if ( empty( phone ) ) {
tips.error( '请先添加电话' );
return;
}
sure.init( '用户名:' + phone + ', 密码:' + Param.resetPwd + ' , 确定吗?' , function () {
$.get( Param.uri.createSysUser + id )
.fail( function ( res ) {
tips.error( res.responseText );
} )
.done( function ( res ) {
if ( res.code > 0 ) {
tips.error( res.msg );
} else {
tips.success( res.msg );
$( '#dataGrid' ).TableGrid( 'reload' );
}
} );
} );
} );
//区域选择
$( 'input[name="area"]' ).AreaSelection( {
uri : Param.uri.area + '/'
} );
} ,
delData : function ( ids ) {
var self = this;
var data = {
ids : ids,
_token : self.token
};
sure.init( '是否删除?' , function () {
$.post( Param.uri.destroy , data )
.fail( function ( res ) {
tips.error( res.responseText );
}
gitextract_hsg3eqim/
├── .gitattributes
├── .gitignore
├── Func.php
├── README.MD
├── composer.json
├── config/
│ └── backend.php
├── database/
│ └── migrations/
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2017_10_20_100811_create_sys_api_log_table.php
│ ├── 2017_10_20_100853_create_sys_func_table.php
│ ├── 2017_10_20_100900_create_sys_func_privilege_table.php
│ ├── 2017_10_20_100908_create_sys_mail_table.php
│ ├── 2017_10_20_100917_create_sys_merchant_table.php
│ ├── 2017_10_20_100923_create_sys_push_table.php
│ ├── 2017_10_20_100929_create_sys_role_table.php
│ ├── 2017_10_20_100940_create_sys_role_permission_table.php
│ ├── 2017_10_20_100949_create_sys_sms_table.php
│ ├── 2017_10_20_101005_create_sys_statistics_table.php
│ ├── 2017_10_20_101023_create_sys_user_group_table.php
│ ├── 2017_10_20_101030_create_sys_user_role_table.php
│ ├── 2017_10_20_101753_create_sys_app_version_table.php
│ ├── 2017_10_20_102342_create_sys_area_table.php
│ ├── 2017_10_21_024032_create_mer_album_table.php
│ ├── 2017_10_21_024040_create_mer_album_catalog_table.php
│ ├── 2017_10_21_024048_create_mer_album_tag_table.php
│ ├── 2017_10_21_024128_create_mer_goods_catalog_table.php
│ ├── 2017_10_21_024140_create_mer_sys_user_table.php
│ ├── 2017_10_25_071323_create_sys_user_table.php
│ ├── 2017_10_25_075251_create_mer_user_table.php
│ ├── 2017_11_17_034153_create_mer_user_device_table.php
│ ├── 2017_11_17_034153_create_sys_user_device_table.php
│ ├── 2017_11_20_074023_create_mer_user_address_table.php
│ ├── 2017_11_21_070513_create_mer_goods_table.php
│ ├── 2017_11_21_075633_create_mer_user_comments_table.php
│ ├── 2017_11_22_023637_create_mer_order_table.php
│ ├── 2017_11_22_031423_create_mer_articles_table.php
│ ├── 2017_11_22_031451_create_mer_articles_catalog_table.php
│ ├── 2017_11_22_031539_create_mer_ad_table.php
│ ├── 2017_11_22_031555_create_mer_ad_catalog_table.php
│ ├── 2017_11_23_015844_create_mer_goods_profile_table.php
│ ├── 2017_11_23_024951_create_mer_goods_icon_table.php
│ ├── 2017_11_23_051615_create_mer_order_items_table.php
│ ├── 2018_06_13_070749_create_sys_modules_table.php
│ └── 2018_06_23_095013_create_sys_settings_table.php
├── phpunit.xml.dist
├── resources/
│ ├── Api/
│ │ ├── Index.php
│ │ ├── Service/
│ │ │ ├── ApiService.php
│ │ │ └── v1/
│ │ │ ├── system/
│ │ │ │ └── AreaService.php
│ │ │ └── test/
│ │ │ └── LoginService.php
│ │ └── routes.php
│ ├── Models/
│ │ ├── MerAlbum.php
│ │ ├── MerAlbumTag.php
│ │ ├── MerArticles.php
│ │ ├── MerGoodsCatalog.php
│ │ ├── SysUser.php
│ │ └── User.php
│ ├── Service/
│ │ └── MerTokenService.php
│ ├── assets/
│ │ └── static/
│ │ ├── .gitignore
│ │ ├── js/
│ │ │ ├── backend/
│ │ │ │ ├── Generate.js
│ │ │ │ ├── Index.js
│ │ │ │ ├── MerAd.js
│ │ │ │ ├── MerEvent.js
│ │ │ │ ├── MerFunc.js
│ │ │ │ ├── MerGoodsCatalog.js
│ │ │ │ ├── MerRole.js
│ │ │ │ ├── MerSysUser.js
│ │ │ │ ├── MerUser.js
│ │ │ │ ├── MerUserFavorites.js
│ │ │ │ ├── Simulator.js
│ │ │ │ ├── SimulatorReadme.js
│ │ │ │ ├── SysApiLog.js
│ │ │ │ ├── SysAppVersion.js
│ │ │ │ ├── SysArea.js
│ │ │ │ ├── SysFunc.js
│ │ │ │ ├── SysMail.js
│ │ │ │ ├── SysMerchant.js
│ │ │ │ ├── SysMerchantDetail.js
│ │ │ │ ├── SysPush.js
│ │ │ │ ├── SysRole.js
│ │ │ │ ├── SysSms.js
│ │ │ │ └── SysUser.js
│ │ │ ├── global/
│ │ │ │ ├── app.js
│ │ │ │ ├── auth.js
│ │ │ │ └── layout.js
│ │ │ ├── index/
│ │ │ │ ├── Articles.js
│ │ │ │ ├── Auth.js
│ │ │ │ ├── Index.js
│ │ │ │ ├── Questions.js
│ │ │ │ ├── QuestionsCreate.js
│ │ │ │ └── Users.js
│ │ │ └── mp/
│ │ │ ├── Index.js
│ │ │ ├── MerAd.js
│ │ │ ├── MerAdCatalog.js
│ │ │ ├── MerArticles.js
│ │ │ ├── MerArticlesCatalog.js
│ │ │ ├── MerGoods.js
│ │ │ ├── MerGoodsCatalog.js
│ │ │ ├── MerOrder.js
│ │ │ └── MerUser.js
│ │ ├── plugins/
│ │ │ ├── dmg-ui/
│ │ │ │ ├── AreaSelection.js
│ │ │ │ ├── TableGrid.js
│ │ │ │ ├── TreeGrid.js
│ │ │ │ ├── Uploader.js
│ │ │ │ ├── album.js
│ │ │ │ ├── auto_fill.js
│ │ │ │ └── tiles.js
│ │ │ └── jquery-md5/
│ │ │ └── jQuery.md5.js
│ │ ├── src/
│ │ │ ├── js/
│ │ │ │ └── global/
│ │ │ │ ├── app.js
│ │ │ │ ├── custom.js
│ │ │ │ ├── format.js
│ │ │ │ └── layout.js
│ │ │ └── themes/
│ │ │ └── global/
│ │ │ ├── components-rounded.css
│ │ │ ├── custom.css
│ │ │ ├── darkblue.css
│ │ │ ├── error.css
│ │ │ ├── img/
│ │ │ │ └── flags/
│ │ │ │ └── readme.txt
│ │ │ ├── layout.css
│ │ │ └── plugins.css
│ │ └── themes/
│ │ ├── global/
│ │ │ └── login.css
│ │ └── index/
│ │ ├── app.css
│ │ └── articles.css
│ ├── npm/
│ │ └── package.json
│ └── views/
│ ├── auth/
│ │ ├── login.blade.php
│ │ ├── passwords/
│ │ │ ├── email.blade.php
│ │ │ └── reset.blade.php
│ │ └── register.blade.php
│ ├── generate/
│ │ └── index.blade.php
│ ├── home.blade.php
│ ├── index/
│ │ └── index.blade.php
│ ├── layouts/
│ │ └── app.blade.php
│ ├── meralbum/
│ │ └── index.blade.php
│ ├── meralbumcatalog/
│ │ └── index.blade.php
│ ├── merfunc/
│ │ └── index.blade.php
│ ├── mergoodscatalog/
│ │ └── index.blade.php
│ ├── merrole/
│ │ ├── index.blade.php
│ │ └── permission.blade.php
│ ├── mersysuser/
│ │ └── index.blade.php
│ ├── meruser/
│ │ └── index.blade.php
│ ├── modulefunc/
│ │ └── index.blade.php
│ ├── modulerole/
│ │ ├── index.blade.php
│ │ └── permission.blade.php
│ ├── public/
│ │ ├── footer.blade.php
│ │ ├── header.blade.php
│ │ ├── layout.blade.php
│ │ ├── layout1.blade.php
│ │ └── sidebar_menu.blade.php
│ ├── simulator/
│ │ ├── index.blade.php
│ │ └── params.blade.php
│ ├── sysapilog/
│ │ └── index.blade.php
│ ├── sysappversion/
│ │ └── index.blade.php
│ ├── sysarea/
│ │ └── index.blade.php
│ ├── sysfunc/
│ │ └── index.blade.php
│ ├── sysmail/
│ │ └── index.blade.php
│ ├── sysmerchant/
│ │ ├── detail.blade.php
│ │ └── index.blade.php
│ ├── sysmodules/
│ │ ├── index.blade.php
│ │ └── role.blade.php
│ ├── syspush/
│ │ └── index.blade.php
│ ├── sysrole/
│ │ ├── index.blade.php
│ │ └── permission.blade.php
│ ├── syssettings/
│ │ ├── index.blade.php
│ │ └── sms.blade.php
│ ├── syssms/
│ │ └── index.blade.php
│ ├── sysuser/
│ │ └── index.blade.php
│ ├── welcome.blade.php
│ └── widget/
│ ├── Checkbox.blade.php
│ ├── File.blade.php
│ ├── Hidden.blade.php
│ ├── Image.blade.php
│ ├── Radio.blade.php
│ ├── Text.blade.php
│ └── Textarea.blade.php
├── router/
│ └── routes.php
├── src/
│ ├── Auth/
│ │ └── Database/
│ │ └── seeds/
│ │ └── AdminTableSeeder.php
│ ├── Console/
│ │ ├── InstallCommand.php
│ │ └── UninstallCommand.php
│ ├── Controllers/
│ │ ├── Backend/
│ │ │ ├── AuthController.php
│ │ │ ├── Backend.php
│ │ │ ├── Generate.php
│ │ │ ├── Index.php
│ │ │ ├── MerAlbum.php
│ │ │ ├── MerAlbumCatalog.php
│ │ │ ├── MerAlbumTag.php
│ │ │ ├── MerFunc.php
│ │ │ ├── MerGoodsCatalog.php
│ │ │ ├── MerRole.php
│ │ │ ├── MerSysUser.php
│ │ │ ├── MerUser.php
│ │ │ ├── ModuleFunc.php
│ │ │ ├── ModuleRole.php
│ │ │ ├── Simulator.php
│ │ │ ├── SysApiLog.php
│ │ │ ├── SysAppVersion.php
│ │ │ ├── SysArea.php
│ │ │ ├── SysBase.php
│ │ │ ├── SysFunc.php
│ │ │ ├── SysMail.php
│ │ │ ├── SysMerchant.php
│ │ │ ├── SysModule.php
│ │ │ ├── SysPush.php
│ │ │ ├── SysRole.php
│ │ │ ├── SysSettings.php
│ │ │ ├── SysSms.php
│ │ │ └── SysUser.php
│ │ └── Controller.php
│ ├── Extensions/
│ │ └── EloquentUserProvider.php
│ ├── Interfaces/
│ │ └── TokenService.php
│ ├── Lib/
│ │ └── Discover.php
│ ├── Middleware/
│ │ ├── CheckToken.php
│ │ ├── Cors.php
│ │ ├── Permission.php
│ │ └── ResetPassword.php
│ ├── Models/
│ │ ├── MerAlbum.php
│ │ ├── MerAlbumCatalog.php
│ │ ├── MerAlbumTag.php
│ │ ├── MerGoodsCatalog.php
│ │ ├── MerSysUser.php
│ │ ├── MerUser.php
│ │ ├── MerUserDevice.php
│ │ ├── SysApiLog.php
│ │ ├── SysAppVersion.php
│ │ ├── SysArea.php
│ │ ├── SysFunc.php
│ │ ├── SysFuncPrivilege.php
│ │ ├── SysMail.php
│ │ ├── SysMerchant.php
│ │ ├── SysModule.php
│ │ ├── SysPush.php
│ │ ├── SysRole.php
│ │ ├── SysRolePermission.php
│ │ ├── SysSettings.php
│ │ ├── SysSms.php
│ │ ├── SysStatistics.php
│ │ ├── SysUser.php
│ │ ├── SysUserDevice.php
│ │ ├── SysUserRole.php
│ │ └── User.php
│ ├── Service/
│ │ ├── BaseService.php
│ │ ├── GenerateService.php
│ │ ├── MerAlbumCatalogService.php
│ │ ├── MerAlbumService.php
│ │ ├── MerAlbumTagService.php
│ │ ├── MerGoodsCatalogService.php
│ │ ├── MerSysUserService.php
│ │ ├── MerUserService.php
│ │ ├── ServiceManager.php
│ │ ├── SimulatorService.php
│ │ ├── SysApiLogService.php
│ │ ├── SysAppVersionService.php
│ │ ├── SysAreaService.php
│ │ ├── SysFuncPrivilegeService.php
│ │ ├── SysFuncService.php
│ │ ├── SysMailService.php
│ │ ├── SysMerchantService.php
│ │ ├── SysModulesService.php
│ │ ├── SysPushService.php
│ │ ├── SysRolePermissionService.php
│ │ ├── SysRoleService.php
│ │ ├── SysSettingsService.php
│ │ ├── SysSmsService.php
│ │ ├── SysUserDeviceService.php
│ │ ├── SysUserRoleService.php
│ │ ├── SysUserService.php
│ │ ├── UploadManager.php
│ │ ├── UploadService.php
│ │ ├── WidgetService.php
│ │ └── widget/
│ │ ├── RadioWidget.php
│ │ └── TextWidget.php
│ ├── SmartServiceProvider.php
│ └── Traits/
│ ├── api/
│ │ └── Service.php
│ └── service/
│ ├── GridTable.php
│ ├── Instance.php
│ ├── Scope.php
│ ├── ScopeMer.php
│ └── TreeTable.php
├── templates/
│ ├── generate/
│ │ ├── api/
│ │ │ ├── api.txt
│ │ │ ├── auth_user.txt
│ │ │ └── params/
│ │ │ ├── api_token.txt
│ │ │ ├── goodsId.txt
│ │ │ ├── merId.txt
│ │ │ ├── orderId.txt
│ │ │ ├── page.txt
│ │ │ ├── pageSize.txt
│ │ │ ├── phone.txt
│ │ │ └── status.txt
│ │ └── system/
│ │ ├── component/
│ │ │ ├── editor/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── editor_decode.txt
│ │ │ │ │ ├── editor_js.txt
│ │ │ │ │ └── editor_uri.txt
│ │ │ │ └── js/
│ │ │ │ ├── editor_clear.txt
│ │ │ │ ├── editor_init.txt
│ │ │ │ ├── editor_reload.txt
│ │ │ │ └── editor_upload_uri.txt
│ │ │ ├── field/
│ │ │ │ └── view/
│ │ │ │ ├── editor.txt
│ │ │ │ ├── input.txt
│ │ │ │ ├── radio.txt
│ │ │ │ ├── select.txt
│ │ │ │ ├── select2.txt
│ │ │ │ └── upload.txt
│ │ │ ├── select2/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── select2_css.txt
│ │ │ │ │ ├── select2_js.txt
│ │ │ │ │ └── select2_uri.txt
│ │ │ │ └── js/
│ │ │ │ ├── select2_clear.txt
│ │ │ │ ├── select2_init.txt
│ │ │ │ └── select2_set.txt
│ │ │ ├── table_type/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── grid_js.txt
│ │ │ │ │ ├── grid_read.txt
│ │ │ │ │ ├── tree_grid_js.txt
│ │ │ │ │ └── tree_grid_read.txt
│ │ │ │ ├── js/
│ │ │ │ │ ├── grid_id.txt
│ │ │ │ │ ├── grid_init.txt
│ │ │ │ │ ├── grid_plugin.txt
│ │ │ │ │ ├── tree_grid_id.txt
│ │ │ │ │ ├── tree_grid_init.txt
│ │ │ │ │ └── tree_grid_plugin.txt
│ │ │ │ ├── service/
│ │ │ │ │ ├── grid.txt
│ │ │ │ │ ├── grid_trait.txt
│ │ │ │ │ ├── tree_grid.txt
│ │ │ │ │ └── tree_grid_trait.txt
│ │ │ │ └── view/
│ │ │ │ ├── grid.txt
│ │ │ │ └── tree_grid.txt
│ │ │ ├── traits/
│ │ │ │ └── instance_trait.txt
│ │ │ ├── upload/
│ │ │ │ ├── controller/
│ │ │ │ │ ├── upload_js.txt
│ │ │ │ │ ├── upload_param.txt
│ │ │ │ │ └── upload_uri.txt
│ │ │ │ └── js/
│ │ │ │ ├── upload_button.txt
│ │ │ │ ├── upload_preview_clear.txt
│ │ │ │ └── upload_preview_set.txt
│ │ │ └── view_type/
│ │ │ ├── js/
│ │ │ │ ├── modal.txt
│ │ │ │ └── portlet.txt
│ │ │ └── view/
│ │ │ ├── modal.txt
│ │ │ └── portlet.txt
│ │ ├── controller.txt
│ │ ├── js.txt
│ │ ├── model.txt
│ │ ├── service.txt
│ │ └── view.txt
│ └── module/
│ ├── config.txt
│ ├── controllers/
│ │ ├── index.txt
│ │ └── module.txt
│ ├── providers/
│ │ └── mainproviders.txt
│ ├── routes.txt
│ └── views/
│ └── Index/
│ └── index.txt
└── tests/
├── CreatesApplication.php
├── IndexTest.php
├── Simulator.php
├── SysFuncTest.php
├── SysUserTest.php
├── TestCase.php
├── config/
│ ├── backend.php
│ └── filesystems.php
├── factories/
│ └── factory.php
└── router/
└── routes.php
SYMBOL INDEX (711 symbols across 163 files)
FILE: Func.php
function full_uri (line 3) | function full_uri($uri, $param = []) {
function extend (line 17) | function extend($default, $config) {
function form_radios (line 40) | function form_radios($name, $data, $checked_value = 0) {
function form_radio_rows (line 69) | function form_radio_rows($name, $data, $key = 'id', $val = 'name', $chec...
function form_radio (line 88) | function form_radio($name, $data, $checked_value = 0, $title) {
function form_text2 (line 102) | function form_text2($name, $value = 0, $title, $help = '', $placeholder ...
function form_field (line 118) | function form_field($param) {
function ajax_arr (line 134) | function ajax_arr($msg, $code = 500, $data = []) {
function form_options (line 157) | function form_options($data, $selected_value = -1) {
function form_checkbox_rows (line 184) | function form_checkbox_rows($name, $data, $key = 'id', $val = 'name', $c...
function str2pwd (line 207) | function str2pwd($str) {
function json (line 214) | function json(Array $array) {
function api_result (line 221) | function api_result($msg, $code_or_data = 500, $data = []) {
function rand_string (line 249) | function rand_string($length = 6) {
function form_options_rows (line 275) | function form_options_rows($data, $id = 'id', $text = "name", $node_fiel...
function form_options_rows_group (line 315) | function form_options_rows_group($data, $valueField = 'id', $textField =...
function file_size (line 337) | function file_size($size) {
function full_img_uri (line 357) | function full_img_uri($imgUri) {
function css (line 374) | function css() {
function js (line 390) | function js() {
function script (line 405) | function script() {
function human_filesize (line 417) | function human_filesize($bytes, $decimals = 2)
function is_image (line 430) | function is_image($mimeType)
FILE: database/migrations/2014_10_12_000000_create_users_table.php
class CreateUsersTable (line 7) | class CreateUsersTable extends Migration
method up (line 14) | public function up()
method down (line 31) | public function down()
FILE: database/migrations/2014_10_12_100000_create_password_resets_table.php
class CreatePasswordResetsTable (line 7) | class CreatePasswordResetsTable extends Migration
method up (line 14) | public function up()
method down (line 28) | public function down()
FILE: database/migrations/2017_10_20_100811_create_sys_api_log_table.php
class CreateSysApiLogTable (line 7) | class CreateSysApiLogTable extends Migration
method up (line 14) | public function up()
method down (line 33) | public function down()
FILE: database/migrations/2017_10_20_100853_create_sys_func_table.php
class CreateSysFuncTable (line 7) | class CreateSysFuncTable extends Migration
method up (line 14) | public function up()
method down (line 40) | public function down()
FILE: database/migrations/2017_10_20_100900_create_sys_func_privilege_table.php
class CreateSysFuncPrivilegeTable (line 7) | class CreateSysFuncPrivilegeTable extends Migration
method up (line 14) | public function up()
method down (line 28) | public function down()
FILE: database/migrations/2017_10_20_100908_create_sys_mail_table.php
class CreateSysMailTable (line 7) | class CreateSysMailTable extends Migration
method up (line 14) | public function up()
method down (line 35) | public function down()
FILE: database/migrations/2017_10_20_100917_create_sys_merchant_table.php
class CreateSysMerchantTable (line 7) | class CreateSysMerchantTable extends Migration
method up (line 14) | public function up()
method down (line 43) | public function down()
FILE: database/migrations/2017_10_20_100923_create_sys_push_table.php
class CreateSysPushTable (line 7) | class CreateSysPushTable extends Migration
method up (line 14) | public function up()
method down (line 38) | public function down()
FILE: database/migrations/2017_10_20_100929_create_sys_role_table.php
class CreateSysRoleTable (line 7) | class CreateSysRoleTable extends Migration
method up (line 14) | public function up()
method down (line 34) | public function down()
FILE: database/migrations/2017_10_20_100940_create_sys_role_permission_table.php
class CreateSysRolePermissionTable (line 7) | class CreateSysRolePermissionTable extends Migration
method up (line 14) | public function up()
method down (line 28) | public function down()
FILE: database/migrations/2017_10_20_100949_create_sys_sms_table.php
class CreateSysSmsTable (line 7) | class CreateSysSmsTable extends Migration
method up (line 14) | public function up()
method down (line 36) | public function down()
FILE: database/migrations/2017_10_20_101005_create_sys_statistics_table.php
class CreateSysStatisticsTable (line 7) | class CreateSysStatisticsTable extends Migration
method up (line 14) | public function up()
method down (line 34) | public function down()
FILE: database/migrations/2017_10_20_101023_create_sys_user_group_table.php
class CreateSysUserGroupTable (line 7) | class CreateSysUserGroupTable extends Migration
method up (line 14) | public function up()
method down (line 28) | public function down()
FILE: database/migrations/2017_10_20_101030_create_sys_user_role_table.php
class CreateSysUserRoleTable (line 7) | class CreateSysUserRoleTable extends Migration
method up (line 14) | public function up()
method down (line 28) | public function down()
FILE: database/migrations/2017_10_20_101753_create_sys_app_version_table.php
class CreateSysAppVersionTable (line 7) | class CreateSysAppVersionTable extends Migration
method up (line 14) | public function up()
method down (line 34) | public function down()
FILE: database/migrations/2017_10_20_102342_create_sys_area_table.php
class CreateSysAreaTable (line 7) | class CreateSysAreaTable extends Migration
method up (line 14) | public function up()
method down (line 32) | public function down()
FILE: database/migrations/2017_10_21_024032_create_mer_album_table.php
class CreateMerAlbumTable (line 7) | class CreateMerAlbumTable extends Migration
method up (line 14) | public function up()
method down (line 35) | public function down()
FILE: database/migrations/2017_10_21_024040_create_mer_album_catalog_table.php
class CreateMerAlbumCatalogTable (line 7) | class CreateMerAlbumCatalogTable extends Migration
method up (line 14) | public function up()
method down (line 32) | public function down()
FILE: database/migrations/2017_10_21_024048_create_mer_album_tag_table.php
class CreateMerAlbumTagTable (line 7) | class CreateMerAlbumTagTable extends Migration
method up (line 14) | public function up()
method down (line 28) | public function down()
FILE: database/migrations/2017_10_21_024128_create_mer_goods_catalog_table.php
class CreateMerGoodsCatalogTable (line 7) | class CreateMerGoodsCatalogTable extends Migration
method up (line 14) | public function up()
method down (line 36) | public function down()
FILE: database/migrations/2017_10_21_024140_create_mer_sys_user_table.php
class CreateMerSysUserTable (line 7) | class CreateMerSysUserTable extends Migration
method up (line 14) | public function up()
method down (line 32) | public function down()
FILE: database/migrations/2017_10_25_071323_create_sys_user_table.php
class CreateSysUserTable (line 7) | class CreateSysUserTable extends Migration {
method up (line 13) | public function up() {
method down (line 39) | public function down() {
FILE: database/migrations/2017_10_25_075251_create_mer_user_table.php
class CreateMerUserTable (line 7) | class CreateMerUserTable extends Migration
method up (line 14) | public function up()
method down (line 48) | public function down()
FILE: database/migrations/2017_11_17_034153_create_mer_user_device_table.php
class CreateMerUserDeviceTable (line 7) | class CreateMerUserDeviceTable extends Migration
method up (line 14) | public function up()
method down (line 34) | public function down()
FILE: database/migrations/2017_11_17_034153_create_sys_user_device_table.php
class CreateSysUserDeviceTable (line 7) | class CreateSysUserDeviceTable extends Migration {
method up (line 13) | public function up() {
method down (line 33) | public function down() {
FILE: database/migrations/2017_11_20_074023_create_mer_user_address_table.php
class CreateMerUserAddressTable (line 7) | class CreateMerUserAddressTable extends Migration
method up (line 14) | public function up()
method down (line 37) | public function down()
FILE: database/migrations/2017_11_21_070513_create_mer_goods_table.php
class CreateMerGoodsTable (line 7) | class CreateMerGoodsTable extends Migration
method up (line 14) | public function up()
method down (line 57) | public function down()
FILE: database/migrations/2017_11_21_075633_create_mer_user_comments_table.php
class CreateMerUserCommentsTable (line 7) | class CreateMerUserCommentsTable extends Migration
method up (line 14) | public function up()
method down (line 35) | public function down()
FILE: database/migrations/2017_11_22_023637_create_mer_order_table.php
class CreateMerOrderTable (line 7) | class CreateMerOrderTable extends Migration
method up (line 14) | public function up()
method down (line 51) | public function down()
FILE: database/migrations/2017_11_22_031423_create_mer_articles_table.php
class CreateMerArticlesTable (line 7) | class CreateMerArticlesTable extends Migration
method up (line 14) | public function up()
method down (line 45) | public function down()
FILE: database/migrations/2017_11_22_031451_create_mer_articles_catalog_table.php
class CreateMerArticlesCatalogTable (line 7) | class CreateMerArticlesCatalogTable extends Migration
method up (line 14) | public function up()
method down (line 35) | public function down()
FILE: database/migrations/2017_11_22_031539_create_mer_ad_table.php
class CreateMerAdTable (line 7) | class CreateMerAdTable extends Migration
method up (line 14) | public function up()
method down (line 37) | public function down()
FILE: database/migrations/2017_11_22_031555_create_mer_ad_catalog_table.php
class CreateMerAdCatalogTable (line 7) | class CreateMerAdCatalogTable extends Migration
method up (line 14) | public function up()
method down (line 33) | public function down()
FILE: database/migrations/2017_11_23_015844_create_mer_goods_profile_table.php
class CreateMerGoodsProfileTable (line 7) | class CreateMerGoodsProfileTable extends Migration
method up (line 14) | public function up()
method down (line 31) | public function down()
FILE: database/migrations/2017_11_23_024951_create_mer_goods_icon_table.php
class CreateMerGoodsIconTable (line 7) | class CreateMerGoodsIconTable extends Migration
method up (line 14) | public function up()
method down (line 31) | public function down()
FILE: database/migrations/2017_11_23_051615_create_mer_order_items_table.php
class CreateMerOrderItemsTable (line 7) | class CreateMerOrderItemsTable extends Migration
method up (line 14) | public function up()
method down (line 39) | public function down()
FILE: database/migrations/2018_06_13_070749_create_sys_modules_table.php
class CreateSysModulesTable (line 7) | class CreateSysModulesTable extends Migration {
method up (line 13) | public function up() {
method down (line 35) | public function down() {
FILE: database/migrations/2018_06_23_095013_create_sys_settings_table.php
class CreateSysSettingsTable (line 7) | class CreateSysSettingsTable extends Migration {
method up (line 13) | public function up() {
method down (line 30) | public function down() {
FILE: resources/Api/Index.php
class Index (line 15) | class Index {
method __construct (line 19) | public function __construct() {
method index (line 24) | public function index(Request $request , $version , $directory , $acti...
method response (line 58) | private function response( $version , $directory , $action , $params ) {
method checkRequestMethod (line 87) | private function checkRequestMethod( $allowRequestMethod = [] ) {
FILE: resources/Api/Service/ApiService.php
class ApiService (line 23) | class ApiService {
method params (line 61) | public function params($params = []){
method getError (line 65) | public function getError( $code ) {
method signature (line 76) | public function signature( $inputArr ) {
method validSignature (line 104) | public function validSignature( $metaData , $signature ) {
method validTimestamp (line 127) | public function validTimestamp( $timestamp ) {
method validToken (line 143) | public function validToken( ) {
method validParams (line 204) | public function validParams() {
method formatData (line 290) | public function formatData( $data , $defaultResponse = [] ) {
method formatDataForRow (line 324) | private function formatDataForRow( $defaultResponse , $data ) {
method formatIcon (line 346) | public function formatIcon( $value , $row = [] ) {
method formatPhone (line 355) | public function formatPhone( $value , $row = [] ) {
method log (line 365) | public function log( $key , $value = '' ) {$this->debug = true;
method logStat (line 389) | public function logStat( $param ) {
method statistics (line 402) | protected function statistics($data){
FILE: resources/Api/Service/v1/system/AreaService.php
class AreaService (line 15) | class AreaService extends ApiService {
method instance (line 49) | public static function instance( $params = [] ) {
method response (line 63) | public function response() {
method get (line 87) | public function get() {
FILE: resources/Api/Service/v1/test/LoginService.php
class LoginService (line 13) | class LoginService extends ApiService {
method instance (line 58) | public static function instance( $params = [] ) {
method response (line 72) | public function response() {
method get (line 105) | public function get() {
method post (line 116) | public function post() {
method put (line 127) | public function put() {
method delete (line 137) | public function delete() {
FILE: resources/Models/MerAlbum.php
class MerAlbum (line 11) | class MerAlbum extends Model {
FILE: resources/Models/MerAlbumTag.php
class MerAlbumTag (line 11) | class MerAlbumTag extends Model {
FILE: resources/Models/MerArticles.php
class MerArticles (line 11) | class MerArticles extends Model {
FILE: resources/Models/MerGoodsCatalog.php
class MerGoodsCatalog (line 11) | class MerGoodsCatalog extends Model {
FILE: resources/Models/SysUser.php
class SysUser (line 9) | class SysUser extends Authenticatable {
method sysMerchants (line 20) | public function sysMerchants() {
method scopeKeyword (line 24) | public function scopeKeyword($query, $param) {
method username (line 34) | public function username() {
FILE: resources/Models/User.php
class User (line 8) | class User extends Authenticatable
FILE: resources/Service/MerTokenService.php
class MerTokenService (line 12) | class MerTokenService extends BaseService implements TokenService{
method getByToken (line 15) | public function getByToken($token){
FILE: resources/assets/static/js/backend/Simulator.js
function signature (line 312) | function signature( data , timestamp , secret ) {
function jsonFormat (line 428) | function jsonFormat( txt , compress ) {
FILE: resources/assets/static/plugins/dmg-ui/TableGrid.js
function loadData (line 66) | function loadData( $this ) {
function render (line 93) | function render( $this , ret ) {
function pagination (line 165) | function pagination( $this ) {
function set_pagination_info (line 252) | function set_pagination_info( $this ) {
function getSortClass (line 283) | function getSortClass( order ) {
function setSort (line 297) | function setSort( $this ) {
FILE: resources/assets/static/plugins/dmg-ui/TreeGrid.js
function expandTr (line 52) | function expandTr(tbody, pid) {
function closeTr (line 64) | function closeTr(tbody, pid) {
function loadData (line 77) | function loadData($this) {
function pagination (line 127) | function pagination($this) {
function set_pagination_info (line 214) | function set_pagination_info($this) {
function _makeBody (line 245) | function _makeBody($this, bodyHtml, rows, settings) {
function getRowById (line 373) | function getRowById(id, rows, settings) {
FILE: resources/assets/static/plugins/dmg-ui/Uploader.js
function setCrop (line 137) | function setCrop( c ) {
function resetCrop (line 145) | function resetCrop() {
function loadAlbum (line 340) | function loadAlbum( $this , $target ) {
function renderImg (line 387) | function renderImg( $target , rows ) {
FILE: resources/assets/static/plugins/dmg-ui/album.js
function load_album (line 107) | function load_album( $this , $target ) {
function render_img (line 152) | function render_img( $target , rows ) {
FILE: src/Auth/Database/seeds/AdminTableSeeder.php
class AdminTableSeeder (line 8) | class AdminTableSeeder extends Seeder {
method run (line 14) | public function run() {
FILE: src/Console/InstallCommand.php
class InstallCommand (line 10) | class InstallCommand extends Command
method __construct (line 33) | public function __construct()
method handle (line 43) | public function handle()
method initData (line 67) | public function initData($module){
method initDirectory (line 84) | public function initDirectory($module){
method initController (line 98) | public function initController($module){
method initExampleController (line 109) | public function initExampleController($module){
method initMigration (line 116) | public function initMigration($module){
method initMiddleware (line 121) | public function initMiddleware($module){
method initProviders (line 126) | public function initProviders($module){
method initView (line 140) | public function initView($module){
method initRoutes (line 155) | public function initRoutes($module){
method initConfig (line 163) | public function initConfig($module){
method getContent (line 170) | protected function getContent($path , $param){
method makeDir (line 186) | protected function makeDir($path = '')
FILE: src/Console/UninstallCommand.php
class UninstallCommand (line 7) | class UninstallCommand extends Command {
method __construct (line 27) | public function __construct() {
method handle (line 36) | public function handle() {
FILE: src/Controllers/Backend/AuthController.php
class AuthController (line 17) | class AuthController extends Backend {
method __construct (line 23) | public function __construct(Request $request){
method changePassword (line 29) | public function changePassword(Request $request){
FILE: src/Controllers/Backend/Backend.php
class Backend (line 18) | class Backend extends SysBase{
method __construct (line 22) | public function __construct(Request $request)
method _init (line 31) | public function _init($pageTitle = '新页面'){
method _displayWithLayout (line 58) | public function _displayWithLayout( $view = 'index'){
FILE: src/Controllers/Backend/Generate.php
class Generate (line 15) | class Generate extends Backend {
method index (line 22) | public function index() {
method get_system_info (line 69) | function get_system_info(Request $request) {
method create_system (line 84) | function create_system(Request $request) {
method create_api (line 92) | function create_api(Request $request) {
method destroy_system_file (line 107) | function destroy_system_file(Request $request) {
FILE: src/Controllers/Backend/Index.php
class Index (line 14) | class Index extends Backend {
method __construct (line 18) | public function __construct(Request $request) {
method index (line 29) | public function index(Request $request) {
method _getCharts (line 69) | private function _getCharts($stat) {
FILE: src/Controllers/Backend/MerAlbum.php
class MerAlbum (line 16) | class MerAlbum extends Backend{
method index (line 24) | public function index(Request $request ) {
method read (line 70) | public function read(Request $request) {
method upload (line 88) | public function upload(Request $request){
method read_album (line 98) | public function read_album(Request $request){
method read_album_catalog (line 124) | public function read_album_catalog() {
FILE: src/Controllers/Backend/MerAlbumCatalog.php
class MerAlbumCatalog (line 14) | class MerAlbumCatalog extends Backend {
method index (line 22) | public function index(Request $request) {
method read (line 82) | public function read(Request $request) {
FILE: src/Controllers/Backend/MerAlbumTag.php
class MerAlbumTag (line 14) | class MerAlbumTag extends Backend {
method index (line 22) | public function index(Request $request) {
method read (line 66) | public function read(Request $request) {
FILE: src/Controllers/Backend/MerFunc.php
class MerFunc (line 16) | class MerFunc extends Backend {
method __construct (line 26) | public function __construct(Request $request){
method index (line 38) | public function index(Request $request) {
method read (line 84) | function read(Request $request) {
method update_privilege (line 108) | function update_privilege(Request $request , $funcId) {
FILE: src/Controllers/Backend/MerGoodsCatalog.php
class MerGoodsCatalog (line 16) | class MerGoodsCatalog extends Backend {
method index (line 24) | public function index(Request $request) {
method read (line 85) | public function read(Request $request) {
FILE: src/Controllers/Backend/MerRole.php
class MerRole (line 19) | class MerRole extends Backend {
method __construct (line 28) | public function __construct(Request $request){
method index (line 39) | public function index(Request $request) {
method read (line 79) | function read(Request $request) {
method insert (line 102) | public function insert(Request $request) {
method get_permission (line 109) | function get_permission(Request $request) {
method get_privilegeData (line 130) | function get_privilegeData(Request $request){
method update_permission (line 137) | function update_permission(Request $request) {
FILE: src/Controllers/Backend/MerSysUser.php
class MerSysUser (line 17) | class MerSysUser extends Backend {
method index (line 29) | public function index(Request $request , $merId = 0) {
method read (line 86) | public function read(Request $request) {
method insert (line 105) | public function insert(Request $request) {
method update (line 116) | public function update(Request $request , $id) {
method destroy (line 126) | public function destroy(Request $request) {
method reset_pwd (line 141) | public function reset_pwd(Request $request , $id) {
FILE: src/Controllers/Backend/MerUser.php
class MerUser (line 18) | class MerUser extends Backend {
method index (line 30) | public function index(Request $request) {
method read (line 97) | public function read(Request $request) {
method test (line 115) | public function test(Request $request) {
method reset_pwd (line 146) | public function reset_pwd($id) {
FILE: src/Controllers/Backend/ModuleFunc.php
class ModuleFunc (line 16) | class ModuleFunc extends Backend {
method index (line 24) | public function index(Request $request) {
method read (line 70) | public function read(Request $request) {
FILE: src/Controllers/Backend/ModuleRole.php
class ModuleRole (line 19) | class ModuleRole extends Backend {
method index (line 26) | public function index(Request $request) {
method read (line 66) | function read(Request $request) {
method get_permission (line 85) | function get_permission(Request $request) {
method get_privilegeData (line 108) | function get_privilegeData(Request $request) {
method update_permission (line 115) | function update_permission(Request $request) {
FILE: src/Controllers/Backend/Simulator.php
class Simulator (line 19) | class Simulator extends Backend {
method __construct (line 27) | public function __construct(Request $request) {
method index (line 34) | public function index() {
method read_api (line 87) | function read_api(Request $request) {
method read_version (line 101) | public function read_version(){ //TODO 版本控制未完成
method read_params (line 106) | function read_params(Request $request) {
method _fixDefaultResponse (line 139) | private function _fixDefaultResponse($defaultResponse) {
method read_me (line 160) | function read_me() {
FILE: src/Controllers/Backend/SysApiLog.php
class SysApiLog (line 14) | class SysApiLog extends Backend {
method index (line 22) | public function index(Request $request) {
method read (line 66) | public function read(Request $request) {
FILE: src/Controllers/Backend/SysAppVersion.php
class SysAppVersion (line 16) | class SysAppVersion extends Backend {
method index (line 24) | public function index(Request $request) {
method read (line 64) | public function read(Request $request) {
FILE: src/Controllers/Backend/SysArea.php
class SysArea (line 15) | class SysArea extends Backend {
method index (line 23) | public function index(Request $request) {
method read (line 71) | public function read(Request $request) {
FILE: src/Controllers/Backend/SysBase.php
class SysBase (line 20) | class SysBase extends Controller{
method __construct (line 49) | public function __construct(Request $request)
method _initService (line 72) | private function _initService(){
method parseRouteAction (line 84) | private function parseRouteAction($routeAction){
method _init (line 95) | public function _init($pageTitle = '新页面'){
method _initClassJs (line 115) | public function _initClassJs( ){
method _getPageJsPath (line 128) | public function _getPageJsPath() {
method _addJsLib (line 133) | public function _addJsLib($uri){
method _addJsCode (line 137) | public function _addJsCode($code = ''){
method _addCssLib (line 141) | public function _addCssLib($uri){
method _addCssCode (line 145) | public function _addCssCode($code){
method _addParam (line 149) | public function _addParam( $key , $value = '' ){
method _addData (line 167) | public function _addData($key ,$value){
method _makeJs (line 185) | public function _makeJs(){
method _makeCss (line 212) | public function _makeCss(){
method _empty (line 221) | public function _empty(){
method upload (line 225) | public function upload(Request $request){
method read_album (line 235) | public function read_album(Request $request){
method read_album_catalog (line 261) | public function read_album_catalog() {
method read_area (line 275) | public function read_area($pid){
method insert (line 293) | public function insert(Request $request){
method update (line 298) | public function update(Request $request ,$id){
method destroy (line 305) | public function destroy(Request $request){
FILE: src/Controllers/Backend/SysFunc.php
class SysFunc (line 15) | class SysFunc extends Backend {
method index (line 18) | public function index(Request $request) {
method read (line 58) | function read(Request $request) {
method update_privilege (line 82) | function update_privilege(Request $request) {
FILE: src/Controllers/Backend/SysMail.php
class SysMail (line 15) | class SysMail extends Backend {
method index (line 20) | public function index(Request $request) {
method read (line 56) | public function read(Request $request) {
method send (line 73) | public function send(Request $request) {
FILE: src/Controllers/Backend/SysMerchant.php
class SysMerchant (line 14) | class SysMerchant extends Backend {
method index (line 19) | public function index(Request $request) {
method read (line 80) | function read(Request $request) {
method read_detail (line 98) | function read_detail($id) {
FILE: src/Controllers/Backend/SysModule.php
class SysModule (line 14) | class SysModule extends Backend {
method index (line 19) | public function index(Request $request) {
method read (line 56) | public function read(Request $request) {
FILE: src/Controllers/Backend/SysPush.php
class SysPush (line 16) | class SysPush extends Backend {
method index (line 21) | public function index(Request $request , SysPushService $sysPushServic...
method read (line 64) | function read(Request $request) {
method send (line 81) | function send(Request $request) {
FILE: src/Controllers/Backend/SysRole.php
class SysRole (line 17) | class SysRole extends Backend {
method index (line 24) | public function index(Request $request) {
method read (line 58) | function read(Request $request) {
method get_permission (line 75) | function get_permission(Request $request) {
method get_privilegeData (line 98) | function get_privilegeData(Request $request) {
method update_permission (line 105) | function update_permission(Request $request) {
FILE: src/Controllers/Backend/SysSettings.php
class SysSettings (line 13) | class SysSettings extends Backend {
method index (line 18) | public function index(Request $request) {
method indexGroup (line 50) | public function indexGroup(Request $request, $group) {
method read (line 59) | public function read(Request $request) {
FILE: src/Controllers/Backend/SysSms.php
class SysSms (line 16) | class SysSms extends Backend {
method index (line 21) | public function index(Request $request) {
method read (line 59) | function read(Request $request) {
FILE: src/Controllers/Backend/SysUser.php
class SysUser (line 18) | class SysUser extends Backend {
method index (line 30) | public function index(Request $request) {
method read (line 86) | public function read(Request $request) {
method test (line 104) | public function test(Request $request) {
method reset_pwd (line 135) | public function reset_pwd($id) {
FILE: src/Controllers/Controller.php
class Controller (line 10) | class Controller extends BaseController
FILE: src/Extensions/EloquentUserProvider.php
class EloquentUserProvider (line 7) | class EloquentUserProvider extends BaseUserProvider
method retrieveByCredentials (line 15) | public function retrieveByCredentials(array $credentials)
FILE: src/Interfaces/TokenService.php
type TokenService (line 10) | interface TokenService{
FILE: src/Lib/Discover.php
class Discover (line 8) | class Discover{
method __construct (line 14) | public function __construct(){
method version (line 20) | public function version(){
method dir (line 40) | public function dir($version){
method service (line 46) | public function service($version){
method _parser (line 105) | private function _parser($class){
FILE: src/Middleware/CheckToken.php
class CheckToken (line 8) | class CheckToken
method __construct (line 22) | public function __construct()
method handle (line 28) | public function handle($request, Closure $next)
method terminate (line 59) | public function terminate($request , $response){
FILE: src/Middleware/Cors.php
class Cors (line 8) | class Cors
method handle (line 20) | public function handle($request, Closure $next)
FILE: src/Middleware/Permission.php
class Permission (line 13) | class Permission {
method handle (line 21) | public function handle($request, Closure $next) {
FILE: src/Middleware/ResetPassword.php
class ResetPassword (line 9) | class ResetPassword
method handle (line 21) | public function handle($request, Closure $next)
FILE: src/Models/MerAlbum.php
class MerAlbum (line 11) | class MerAlbum extends Model {
method scopeKeyword (line 22) | public function scopeKeyword( $query , $param){
method tag (line 27) | public function tag(){
FILE: src/Models/MerAlbumCatalog.php
class MerAlbumCatalog (line 7) | class MerAlbumCatalog extends Model
method scopeKeyword (line 19) | public function scopeKeyword( $query , $param){
method scopeMerId (line 24) | public function scopeMerId( $query , $param){
method album (line 32) | public function album(){
FILE: src/Models/MerAlbumTag.php
class MerAlbumTag (line 11) | class MerAlbumTag extends Model {
method scopeKeyword (line 20) | public function scopeKeyword( $query , $param){
FILE: src/Models/MerGoodsCatalog.php
class MerGoodsCatalog (line 7) | class MerGoodsCatalog extends Model
method scopeKeyword (line 17) | public function scopeKeyword($query , $param){
FILE: src/Models/MerSysUser.php
class MerSysUser (line 7) | class MerSysUser extends Model
method scopeKeyword (line 18) | public function scopeKeyword($query ,$param){
FILE: src/Models/MerUser.php
class MerUser (line 7) | class MerUser extends Model
method scopeKeyword (line 19) | public function scopeKeyword($query , $param){
method scopeMerId (line 27) | public function scopeMerId($query , $param){
method scopePhone (line 32) | public function scopePhone($query , $param){
method scopeUsername (line 37) | public function scopeUsername($query , $param){
method scopeNickname (line 42) | public function scopeNickname($query , $param){
method scopeEmail (line 47) | public function scopeEmail($query , $param){
method scopeStatus (line 52) | public function scopeStatus($query , $param){
method scopeExcludeId (line 57) | public function scopeExcludeId($query , $param){
method scopeGetAll (line 62) | public function scopeGetAll($query , $params = ['getAll'=>false]){
FILE: src/Models/MerUserDevice.php
class MerUserDevice (line 7) | class MerUserDevice extends Model
method User (line 9) | public function User(){
FILE: src/Models/SysApiLog.php
class SysApiLog (line 11) | class SysApiLog extends Model {
FILE: src/Models/SysAppVersion.php
class SysAppVersion (line 7) | class SysAppVersion extends Model
method scopeKeyword (line 15) | public function scopeKeyword($query , $param){
FILE: src/Models/SysArea.php
class SysArea (line 7) | class SysArea extends Model
method scopePid (line 17) | public function scopePid($query ,$param){
FILE: src/Models/SysFunc.php
class SysFunc (line 7) | class SysFunc extends Model {
method scopeIsMenu (line 16) | public function scopeIsMenu($query, $param) {
method scopeModule (line 23) | public function scopeModule($query, $param = '') {
method sysRolePermissions (line 29) | public function sysRolePermissions() {
method privilege (line 33) | public function privilege() {
method children (line 37) | public function children(){
FILE: src/Models/SysFuncPrivilege.php
class SysFuncPrivilege (line 7) | class SysFuncPrivilege extends Model {
method sysFunc (line 15) | public function sysFunc() {
FILE: src/Models/SysMail.php
class SysMail (line 7) | class SysMail extends Model
method scopeKeyword (line 17) | public function scopeKeyword($query , $param){
FILE: src/Models/SysMerchant.php
class SysMerchant (line 7) | class SysMerchant extends Model
method scopeKeyword (line 17) | public function scopeKeyword($query , $param){
method sysUsers (line 22) | public function sysUsers(){
FILE: src/Models/SysModule.php
class SysModule (line 8) | class SysModule extends Model
FILE: src/Models/SysPush.php
class SysPush (line 8) | class SysPush extends Model
method scopeKeyword (line 16) | public function scopeKeyword( $query ,$param){
FILE: src/Models/SysRole.php
class SysRole (line 7) | class SysRole extends Model {
method sysFuncPrivileges (line 16) | public function sysFuncPrivileges() {
FILE: src/Models/SysRolePermission.php
class SysRolePermission (line 7) | class SysRolePermission extends Model {
method sysFuncs (line 16) | public function sysFuncs() {
FILE: src/Models/SysSettings.php
class SysSettings (line 11) | class SysSettings extends Model {
FILE: src/Models/SysSms.php
class SysSms (line 7) | class SysSms extends Model
method scopeKeyword (line 17) | public function scopeKeyword($query , $param){
FILE: src/Models/SysStatistics.php
class SysStatistics (line 11) | class SysStatistics extends Model {
FILE: src/Models/SysUser.php
class SysUser (line 9) | class SysUser extends Authenticatable {
method sysMerchants (line 22) | public function sysMerchants() {
method scopeModule (line 26) | public function scopeModule($query , $param = ''){
method sysRole (line 31) | public function sysRole() {
method UserDevice (line 35) | public function UserDevice() {
method scopeKeyword (line 39) | public function scopeKeyword($query, $param) {
method username (line 49) | public function username() {
FILE: src/Models/SysUserDevice.php
class SysUserDevice (line 11) | class SysUserDevice extends Model {
method user (line 22) | public function user() {
FILE: src/Models/SysUserRole.php
class SysUserRole (line 7) | class SysUserRole extends Model
method scopeName (line 18) | public function scopeName( $query ,$param){
FILE: src/Models/User.php
class User (line 8) | class User extends Authenticatable
FILE: src/Service/BaseService.php
class BaseService (line 10) | class BaseService{
FILE: src/Service/GenerateService.php
class GenerateService (line 21) | class GenerateService {
method instance (line 229) | public static function instance() {
method _init (line 237) | private function _init() {
method getTables (line 259) | public function getTables() {
method getSystemComponents (line 269) | private function getSystemComponents() {
method getTableField (line 279) | private function getTableField($tableName) {
method getSystemInfo (line 294) | public function getSystemInfo($tableName, $module, $returnFieldInfo = ...
method getFuncName (line 373) | private function getFuncName($tableName) {
method replaceTmp (line 385) | function replaceTmp($tmpContent, $data) {
method createSystem (line 394) | public function createSystem($data) {
method createComponentTraits (line 441) | private function createComponentTraits($temp, $tempContent, $value){
method createComponentTableType (line 461) | private function createComponentTableType($temp, $tempContent, $value) {
method createComponentViewType (line 490) | private function createComponentViewType($temp, $tempContent, $value) {
method createComponentUpload (line 510) | private function createComponentUpload($temp, $tempContent, $value, $d...
method createComponentEditor (line 550) | private function createComponentEditor($temp, $tempContent, $value, $d...
method createComponentSelect2 (line 582) | private function createComponentSelect2($temp, $tempContent, $value, $...
method createComponentFormField (line 600) | private function createComponentFormField($temp, $components, $field, ...
method saveFile (line 640) | private function saveFile($temp, $filePath, $fileContent) {
method createModel (line 657) | private function createModel($data) {
method createService (line 685) | private function createService($data) {
method createController (line 728) | private function createController($data) {
method createView (line 765) | private function createView($data) {
method createJs (line 828) | private function createJs($data) {
method createApi (line 861) | public function createApi($data) {
method deleteSystemFile (line 906) | public function deleteSystemFile($module, $tableName, $temp) {
FILE: src/Service/MerAlbumCatalogService.php
class MerAlbumCatalogService (line 14) | class MerAlbumCatalogService extends BaseService {
method getDefaultRow (line 28) | function getDefaultRow() {
method getByCond (line 40) | function getByCond( $param ) {
method getByTag (line 70) | function getByTag( $mer_id, $tag, $icon = '', $create_when_not_found =...
method saveByTags (line 105) | function saveByTags( $mer_id, $tags, $album_id, $icon ) {
method destroyOne (line 137) | function destroyOne( $id ) {
FILE: src/Service/MerAlbumService.php
class MerAlbumService (line 13) | class MerAlbumService extends BaseService {
method __construct (line 30) | public function __construct()
method getDefaultRow (line 39) | function getDefaultRow() {
method getByCond (line 61) | public function getByCond( $param ) {
method insert (line 88) | public function insert( $data, $tags = '' ){
FILE: src/Service/MerAlbumTagService.php
class MerAlbumTagService (line 11) | class MerAlbumTagService extends BaseService {
method getDefaultRow (line 28) | function getDefaultRow() {
method getByCond (line 43) | public function getByCond( $param ) {
FILE: src/Service/MerGoodsCatalogService.php
class MerGoodsCatalogService (line 15) | class MerGoodsCatalogService extends BaseService {
method getDefaultRow (line 37) | function getDefaultRow() {
method getByCond (line 54) | public function getByCond( $param ) {
FILE: src/Service/MerSysUserService.php
class MerSysUserService (line 15) | class MerSysUserService extends BaseService {
method getDefaultRow (line 30) | function getDefaultRow() {
method getByCond (line 45) | public function getByCond( $param ) {
method insert (line 80) | function insert( $merId , $data ) {
method update (line 112) | public function update( $id , $data ) {
method destroy (line 136) | public function destroy( $merId , $sys_user_id ) {
FILE: src/Service/MerUserService.php
class MerUserService (line 18) | class MerUserService extends BaseService {
method getDefaultRow (line 43) | function getDefaultRow() {
method getByCond (line 65) | public function getByCond($params) {
method getRoles (line 126) | private function getRoles($data) {
method getMerSysUserByCond (line 143) | private function getMerSysUserByCond($params) {
method uploadPwd (line 177) | function uploadPwd($id, $data) {
method insert (line 195) | public function insert($data) {
method update (line 244) | function update($id, $data) {
method destroy (line 294) | public function destroy($id) {
method resetPwd (line 321) | public function resetPwd($id, $pwd) {
method setUser (line 338) | public function setUser($id) {
method getForTest (line 347) | public function getForTest() {
FILE: src/Service/ServiceManager.php
class ServiceManager (line 10) | class ServiceManager {
method __construct (line 12) | public function __construct() {
method register (line 21) | public function register($classPath) {
method make (line 29) | public function make($serviceName) {
method destroy (line 39) | public function destroy($serviceName) {
FILE: src/Service/SimulatorService.php
class SimulatorService (line 21) | class SimulatorService extends BaseService {
method readApi (line 30) | function readApi( $apiVersion ) {
method readVersion (line 37) | public function readVersion(){
FILE: src/Service/SysApiLogService.php
class SysApiLogService (line 11) | class SysApiLogService extends BaseService {
method getDefaultRow (line 27) | function getDefaultRow() {
method getByCond (line 47) | public function getByCond( $param ) {
FILE: src/Service/SysAppVersionService.php
class SysAppVersionService (line 13) | class SysAppVersionService extends BaseService {
method getDefaultRow (line 34) | function getDefaultRow() {
method getByCond (line 55) | public function getByCond( $param ) {
FILE: src/Service/SysAreaService.php
class SysAreaService (line 14) | class SysAreaService extends BaseService {
method getDefaultRow (line 29) | function getDefaultRow() {
method getByCond (line 47) | function getByCond( $param ) {
FILE: src/Service/SysFuncPrivilegeService.php
class SysFuncPrivilegeService (line 12) | class SysFuncPrivilegeService extends BaseService{
method getDefaultRow (line 41) | public function getDefaultRow(){
method getByCond (line 46) | public function getByCond($param){
method updateByFunc (line 107) | public function updateByFunc( $funcId , $data = [] ) {
method getByFunc (line 161) | public function getByFunc( $funcId ) {
method getByFuncs (line 167) | public function getByFuncs( $funcIds){
FILE: src/Service/SysFuncService.php
class SysFuncService (line 12) | class SysFuncService extends BaseService {
method getDefaultRow (line 41) | public function getDefaultRow() {
method getMenuByRoles (line 65) | public function getMenuByRoles($roleIds, $module) {
method getMenuByRole (line 78) | public function getMenuByRole($roleIds, $module){
method getByUri (line 82) | public function getByUri($uri) {
method getByCond (line 86) | public function getByCond($param) {
method _getMenuByRoles (line 147) | private function _getMenuByRoles($roleIds, $module) {
method withPrivilege (line 183) | public function withPrivilege($data) {
method getPrivilege (line 203) | public function getPrivilege($uri) {
method accept (line 212) | public function accept(SysUserService $sysUserService) {
FILE: src/Service/SysMailService.php
class SysMailService (line 17) | class SysMailService extends BaseService {
method setError (line 44) | public function setError( $error ) {
method getError (line 48) | public function getError() {
method getDefaultRow (line 53) | function getDefaultRow() {
method getByCond (line 75) | public function getByCond( $param ) {
method sendById (line 104) | public function sendById( $id ) {
method sendCaptcha (line 159) | public function sendCaptcha( $address = '' , $data = [] ) {
method setMailSent (line 211) | private function setMailSent( $id ) {
method getCaptcha (line 225) | private function getCaptcha( $len = 4 ) {
method validCaptcha (line 233) | public function validCaptcha( $address , $captcha ) {
FILE: src/Service/SysMerchantService.php
class SysMerchantService (line 14) | class SysMerchantService extends BaseService {
method getDefaultRow (line 35) | function getDefaultRow() {
method getByCond (line 64) | function getByCond( $param ) {
method withSysUser (line 105) | private function withSysUser( $data ) {
method getForTest (line 145) | public function getForTest() {
method getBySysUser (line 156) | public function getBySysUser( $userId ) {
FILE: src/Service/SysModulesService.php
class SysModuleService (line 13) | class SysModuleService extends BaseService {
method getDefaultRow (line 29) | function getDefaultRow() {
method getByCond (line 52) | public function getByCond($param) {
method getById (line 78) | public function getById($id) {
FILE: src/Service/SysPushService.php
class SysPushService (line 18) | class SysPushService extends BaseService {
method initJPush (line 53) | public function initJPush( $appKey = '', $secret = '' ) {
method getDefaultRow (line 61) | public function getDefaultRow() {
method getByCond (line 86) | function getByCond( $param ) {
method bindByUserId (line 123) | public function bindByUserId( $registrationId, $userId ) {
method sendById (line 133) | public function sendById( $id ) {
method sendByCond (line 180) | public function sendByCond( $params ) {
method insert (line 248) | public function insert( $data, $sendImmediately = TRUE ) {
FILE: src/Service/SysRolePermissionService.php
class SysRolePermissionService (line 16) | class SysRolePermissionService extends BaseService {
method getByCond (line 32) | function getByCond( $param ) {
method getPrivilegeByRole (line 74) | public function getPrivilegeByRole( $roleId ) {
method getByRole (line 96) | function getByRole( $roleId ) {
method checkRoleFuncPrivilege (line 110) | function checkRoleFuncPrivilege( $roleId, $module, $func, $privilege ) {
method destroyByFunc (line 154) | function destroyByFunc( $funcId ) {
method updateRolePermission (line 174) | function updateRolePermission( $roleId, $privilegeArr ) {
FILE: src/Service/SysRoleService.php
class SysRoleService (line 13) | class SysRoleService extends BaseService {
method getDefaultRow (line 51) | function getDefaultRow() {
method getByCond (line 66) | function getByCond($param) {
method getById (line 102) | function getById($id) {
method getByModule (line 113) | function getByModule($module) {
FILE: src/Service/SysSettingsService.php
class SysSettingsService (line 12) | class SysSettingsService extends BaseService {
method getDefaultRow (line 28) | function getDefaultRow() {
method getByCond (line 48) | public function getByCond($param) {
FILE: src/Service/SysSmsService.php
class SysSmsService (line 15) | class SysSmsService extends BaseService {
method getDefaultRow (line 40) | function getDefaultRow() {
method getByCond (line 62) | function getByCond( $param ) {
method createByCaptcha (line 97) | public function createByCaptcha( $phone, $sendImmediately = FALSE ) {
method makeCaptcha (line 135) | private function makeCaptcha() {
method sendCaptcha (line 149) | public function sendCaptcha( $phone, $captcha, $tempId ) {
method getByPhoneInOneMin (line 185) | public function getByPhoneInOneMin( $phone ) {
method validCaptcha (line 202) | public function validCaptcha( $phone, $captcha ) {
FILE: src/Service/SysUserDeviceService.php
class SysUserDeviceService (line 12) | class SysUserDeviceService extends BaseService {
method getDefaultRow (line 34) | function getDefaultRow() {
method getByCond (line 57) | public function getByCond($param) {
method generateToken (line 84) | public function generateToken(){
FILE: src/Service/SysUserRoleService.php
class SysUserRoleService (line 14) | class SysUserRoleService extends BaseService {
method getDefaultRow (line 33) | public function getDefaultRow() {
method getByCond (line 48) | public function getByCond( $param ) {
method getByUser (line 86) | public function getByUser( $userId , $concatRole = FALSE ) {
method destroyByUser (line 117) | public function destroyByUser( $userId ) {
method updateByUser (line 135) | public function updateByUser( $userId , $roles = [] ) {
FILE: src/Service/SysUserService.php
class SysUserService (line 18) | class SysUserService extends BaseService {
method getDefaultRow (line 43) | function getDefaultRow() {
method getByCond (line 65) | public function getByCond($params) {
method getRoles (line 126) | private function getRoles($data) {
method getMerSysUserByCond (line 143) | private function getMerSysUserByCond($params) {
method uploadPwd (line 177) | function uploadPwd($id, $data) {
method insert (line 195) | public function insert($data) {
method update (line 244) | function update($id, $data) {
method destroy (line 294) | public function destroy($id) {
method resetPwd (line 321) | public function resetPwd($id, $pwd) {
method setUser (line 338) | public function setUser($id) {
method getForTest (line 347) | public function getForTest() {
FILE: src/Service/UploadManager.php
class UploadsManager (line 9) | class UploadsManager
method __construct (line 14) | public function __construct(PhpRepository $mimeDetect)
method folderInfo (line 32) | public function folderInfo($folder)
method cleanFolder (line 63) | protected function cleanFolder($folder)
method breadcrumbs (line 71) | protected function breadcrumbs($folder)
method fileDetails (line 93) | protected function fileDetails($path)
method fileWebpath (line 110) | public function fileWebpath($path)
method fileMimeType (line 119) | public function fileMimeType($path)
method fileSize (line 129) | public function fileSize($path)
method fileModified (line 137) | public function fileModified($path)
FILE: src/Service/UploadService.php
class UploadService (line 15) | class UploadService {
method instance (line 45) | public static function instance( $inputName = 'imgFile') {
method setError (line 54) | public function setError( $error ) {
method getError (line 58) | public function getError() {
method setInputName (line 62) | public function setInputName( $inputName ) {
method initUpload (line 67) | private function initUpload( $param ) {
method doUpload (line 84) | public function doUpload( $param = [] ) {
method afterUploadSuccess (line 153) | private function afterUploadSuccess() {
method addUploadFtpList (line 203) | private function addUploadFtpList( $filePath ) {
method returnSuccess (line 212) | private function returnSuccess() {
method returnError (line 229) | private function returnError() {
method checkCropThumb (line 246) | private function checkCropThumb() {
method uploadToFtp (line 311) | private function uploadToFtp() {
method saveAsAlbum (line 330) | private function saveAsAlbum() {
FILE: src/Service/WidgetService.php
class WidgetService (line 10) | class WidgetService {
method make (line 19) | public function make($param = []) {
method render (line 28) | public function render() {
method __toString (line 32) | public function __toString() {
FILE: src/Service/widget/RadioWidget.php
class RadioWidget (line 4) | class RadioWidget {
method render (line 9) | public function render() {
method make (line 19) | public function make($param) {
FILE: src/Service/widget/TextWidget.php
class TextWidget (line 4) | class TextWidget {
method render (line 6) | public function render() {
FILE: src/SmartServiceProvider.php
class SmartServiceProvider (line 18) | class SmartServiceProvider extends ServiceProvider {
method boot (line 32) | public function boot() {
method register (line 90) | public function register() {
method registerRouteMiddleware (line 110) | protected function registerRouteMiddleware() {
method registerModuleRouteMiddleware (line 118) | protected function registerModuleRouteMiddleware(){
method registerProvider (line 133) | protected function registerProvider(){
method registerModuleProvider (line 146) | protected function registerModuleProvider(){
method loadProviders (line 158) | private function loadProviders($directory)
method loadProvider (line 184) | private function loadProvider($providerFullName)
FILE: src/Traits/api/Service.php
type Service (line 10) | trait Service {
method validToken (line 25) | public function validToken( $token, $device = '' ) {
method validParam (line 51) | public function validParam( $param, $rule = 'required' ) {
FILE: src/Traits/service/GridTable.php
type GridTable (line 4) | trait GridTable {
method getById (line 12) | public function getById( $id ) {
method insert (line 23) | public function insert( $data ) {
method update (line 45) | public function update( $id , $data ) {
method destroy (line 65) | public function destroy( $ids ) {
FILE: src/Traits/service/Instance.php
type Instance (line 5) | trait Instance{
method instance (line 13) | public static function instance() {
method getModel (line 28) | protected function getModel(){
method setModel (line 32) | protected function setModel(Model $model){
FILE: src/Traits/service/Scope.php
type Scope (line 9) | trait Scope{
method scopeModule (line 11) | public function scopeModule($query , $param = '' ){
method scopeStatus (line 19) | public function scopeStatus($query , $param = ''){
method scopeKeyword (line 24) | public function scopeKeyword($query , $param = ''){
method scopeGetAll (line 31) | public function scopeGetAll($query , $params = ['getAll'=>false]){
FILE: src/Traits/service/ScopeMer.php
type ScopeMer (line 10) | trait ScopeMer{
method scopeMerId (line 12) | public function scopeMerId($query , $param = ''){
FILE: src/Traits/service/TreeTable.php
type TreeTable (line 12) | trait TreeTable {
method getLevel (line 15) | public function getLevel( $pid ) {
method getById (line 34) | public function getById( $id ) {
method getByPid (line 45) | public function getByPid( $pid ) {
method treeToArray (line 50) | private function treeToArray( $arr, $key ) {
method insert (line 71) | public function insert( $data ) {
method update (line 94) | public function update( $id, $data ) {
method destroy (line 119) | public function destroy( $ids ) {
method getFamilyId (line 140) | public function getFamilyId( $param ) {
method _getFamilyId (line 183) | function _getFamilyId( $result, $childrenKey = 'children' ) {
FILE: tests/CreatesApplication.php
type CreatesApplication (line 6) | trait CreatesApplication
method createApplication (line 13) | public function createApplication()
FILE: tests/IndexTest.php
class IndexCase (line 11) | class IndexCase extends TestCase{
method setUp (line 13) | public function setUp(){
method testIndex (line 18) | public function testIndex(){
FILE: tests/Simulator.php
class SimulatorTest (line 6) | class SimulatorTest extends TestCase
method testExample (line 13) | public function testExample()
method setUp (line 18) | public function setUp()
method testIndex (line 24) | public function testIndex(){
FILE: tests/SysFuncTest.php
class SysFuncTest (line 6) | class SysFuncTest extends TestCase
method testExample (line 13) | public function testExample()
method setUp (line 18) | public function setUp()
method testIndex (line 24) | public function testIndex(){
method testCreate (line 37) | public function testCreate(){
method testDelete (line 59) | public function testDelete(){
method testPermission (line 73) | public function testPermission(){
FILE: tests/SysUserTest.php
class SysUserTest (line 6) | class SysUserTest extends TestCase
method testExample (line 13) | public function testExample()
method setUp (line 18) | public function setUp()
method testIndex (line 24) | public function testIndex(){
method testRead (line 33) | public function testRead(){
FILE: tests/TestCase.php
class TestCase (line 10) | abstract class TestCase extends BaseTestCase
method createApplication (line 24) | public function createApplication()
method setUp (line 33) | public function setUp(){
Condensed preview — 352 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,111K chars).
[
{
"path": ".gitattributes",
"chars": 84,
"preview": "*.js linguist-language=PHP\n*.css linguist-language=PHP\n*.html linguist-language=PHP\n"
},
{
"path": ".gitignore",
"chars": 23,
"preview": "/vendor/\ncomposer.lock\n"
},
{
"path": "Func.php",
"chars": 8770,
"preview": "<?php\nif (!function_exists('full_uri')) {\n\tfunction full_uri($uri, $param = []) {\n\t\treturn url(strtolower($uri), $param)"
},
{
"path": "README.MD",
"chars": 5102,
"preview": " laravel-smart\n---------\n\n- 项目的路由,视图文件均在扩展包内,默认的后台请不要作改动啦,项目主要的优势在于API接口的开发,自动生成标准的API文件格式\n- 普通web应用也能做,如果需要添加额外的路由,请直接在"
},
{
"path": "composer.json",
"chars": 1542,
"preview": "{\n \"name\": \"dominator88/laravel-smart\",\n \"description\": \"后台管理系统.能快速度进行移动端开发.集成多个常见工具包.\",\n \"keywords\": [\"admin\","
},
{
"path": "config/backend.php",
"chars": 1214,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: sl\n * Date: 2017/9/14\n * Time: 11:07\n */\nreturn [\n 'version' => '2.0',\n\n "
},
{
"path": "database/migrations/2014_10_12_000000_create_users_table.php",
"chars": 746,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2014_10_12_100000_create_password_resets_table.php",
"chars": 683,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100811_create_sys_api_log_table.php",
"chars": 916,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100853_create_sys_func_table.php",
"chars": 1182,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100900_create_sys_func_privilege_table.php",
"chars": 707,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100908_create_sys_mail_table.php",
"chars": 960,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100917_create_sys_merchant_table.php",
"chars": 1397,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100923_create_sys_push_table.php",
"chars": 1090,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100929_create_sys_role_table.php",
"chars": 919,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100940_create_sys_role_permission_table.php",
"chars": 677,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_100949_create_sys_sms_table.php",
"chars": 981,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_101005_create_sys_statistics_table.php",
"chars": 933,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_101023_create_sys_user_group_table.php",
"chars": 658,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_101030_create_sys_user_role_table.php",
"chars": 654,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_101753_create_sys_app_version_table.php",
"chars": 973,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_20_102342_create_sys_area_table.php",
"chars": 784,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_21_024032_create_mer_album_table.php",
"chars": 1010,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_21_024040_create_mer_album_catalog_table.php",
"chars": 819,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_21_024048_create_mer_album_tag_table.php",
"chars": 658,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_21_024128_create_mer_goods_catalog_table.php",
"chars": 1081,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_21_024140_create_mer_sys_user_table.php",
"chars": 867,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_10_25_071323_create_sys_user_table.php",
"chars": 1087,
"preview": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Fa"
},
{
"path": "database/migrations/2017_10_25_075251_create_mer_user_table.php",
"chars": 1610,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_17_034153_create_mer_user_device_table.php",
"chars": 1066,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_17_034153_create_sys_user_device_table.php",
"chars": 930,
"preview": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Fa"
},
{
"path": "database/migrations/2017_11_20_074023_create_mer_user_address_table.php",
"chars": 1038,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_21_070513_create_mer_goods_table.php",
"chars": 2172,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_21_075633_create_mer_user_comments_table.php",
"chars": 1033,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_22_023637_create_mer_order_table.php",
"chars": 1956,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_22_031423_create_mer_articles_table.php",
"chars": 1399,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_22_031451_create_mer_articles_catalog_table.php",
"chars": 1031,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_22_031539_create_mer_ad_table.php",
"chars": 1064,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_22_031555_create_mer_ad_catalog_table.php",
"chars": 873,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_23_015844_create_mer_goods_profile_table.php",
"chars": 816,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_23_024951_create_mer_goods_icon_table.php",
"chars": 870,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2017_11_23_051615_create_mer_order_items_table.php",
"chars": 1225,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2018_06_13_070749_create_sys_modules_table.php",
"chars": 965,
"preview": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Fa"
},
{
"path": "database/migrations/2018_06_23_095013_create_sys_settings_table.php",
"chars": 824,
"preview": "<?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Fa"
},
{
"path": "phpunit.xml.dist",
"chars": 933,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit backupGlobals=\"false\"\n backupStaticAttributes=\"false\"\n b"
},
{
"path": "resources/Api/Index.php",
"chars": 2506,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/18\n * Time: 21:07\n */\nnamespace Ap"
},
{
"path": "resources/Api/Service/ApiService.php",
"chars": 11003,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/18\n * Time: 21:13\n */\nnamespace Ap"
},
{
"path": "resources/Api/Service/v1/system/AreaService.php",
"chars": 2266,
"preview": "<?php namespace App\\Api\\Service\\v1\\system;\n/**\n * 区域\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/18\n * Time: 21:"
},
{
"path": "resources/Api/Service/v1/test/LoginService.php",
"chars": 2409,
"preview": "<?php\nnamespace App\\Api\\Service\\v1\\test;\n\n/**\n * 测试\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2017-11-14\n"
},
{
"path": "resources/Api/routes.php",
"chars": 305,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/11/14\n * Time: 16:12\n */\n//接口路由\nRout"
},
{
"path": "resources/Models/MerAlbum.php",
"chars": 334,
"preview": "<?php namespace App\\Models;\n/**\n * MerAlbum Model\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2017-09-30\n *"
},
{
"path": "resources/Models/MerAlbumTag.php",
"chars": 344,
"preview": "<?php namespace App\\Models;\n/**\n * MerAlbumTag Model\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2017-10-02"
},
{
"path": "resources/Models/MerArticles.php",
"chars": 343,
"preview": "<?php namespace App\\Models;\n/**\n * MerArticles Model\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2017-09-30"
},
{
"path": "resources/Models/MerGoodsCatalog.php",
"chars": 356,
"preview": "<?php namespace App\\Models;\n/**\n * MerGoodsCatalog Model\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2017-0"
},
{
"path": "resources/Models/SysUser.php",
"chars": 789,
"preview": "<?php\n\nnamespace Smart\\Models;\n\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\nuse Illuminate\\Notifications\\Not"
},
{
"path": "resources/Models/User.php",
"chars": 554,
"preview": "<?php\n\nnamespace App\\Models;\n\nuse Illuminate\\Notifications\\Notifiable;\nuse Illuminate\\Foundation\\Auth\\User as Authentica"
},
{
"path": "resources/Service/MerTokenService.php",
"chars": 621,
"preview": "<?php namespace App\\Service;\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/30\n * Time:"
},
{
"path": "resources/assets/static/.gitignore",
"chars": 0,
"preview": ""
},
{
"path": "resources/assets/static/js/backend/Generate.js",
"chars": 5247,
"preview": "/**\n * 自动生成代码 JS\n *\n * @author Zix\n * @version 2.0 , 2016-09-11\n */\n\nvar Generate = {\n\ttoken : $('input[name=_token]')."
},
{
"path": "resources/assets/static/js/backend/Index.js",
"chars": 1475,
"preview": "var Index = {\n\tinit : function(){\n\t\t// 指定图表的配置项和数据\n\t\tvar usersOption = {\n\t\t\ttooltip : {\n\t\t\t\ttrigger : 'axis'\n\t\t\t} ,\n\t\t\tl"
},
{
"path": "resources/assets/static/js/backend/MerAd.js",
"chars": 5800,
"preview": "/**\n * MerAd JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-14\n */\n\nvar MerAd = {\n\tinit : function "
},
{
"path": "resources/assets/static/js/backend/MerEvent.js",
"chars": 6034,
"preview": "/**\n * MerEvent JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2017-07-17\n */\n\nvar MerEvent = {\n config : "
},
{
"path": "resources/assets/static/js/backend/MerFunc.js",
"chars": 6328,
"preview": "/**\n * MerFunc JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-12\n */\n\nvar MerFunc = {\n\ttoken: $('in"
},
{
"path": "resources/assets/static/js/backend/MerGoodsCatalog.js",
"chars": 6110,
"preview": "/**\n * MerGoodsCatalog JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-10-11\n */\n\nvar MerGoodsCatalog ="
},
{
"path": "resources/assets/static/js/backend/MerRole.js",
"chars": 9988,
"preview": "/**\n * MerRole JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-12\n */\n\nvar MerRole = {\n\ttoken: $('in"
},
{
"path": "resources/assets/static/js/backend/MerSysUser.js",
"chars": 7466,
"preview": "/**\n * SysMerUser JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-27\n */\n\nvar MerSysUser = {\n token"
},
{
"path": "resources/assets/static/js/backend/MerUser.js",
"chars": 7108,
"preview": "/**\n * MerUser JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-27\n */\n\nvar MerUser = {\n\ttoken: $('in"
},
{
"path": "resources/assets/static/js/backend/MerUserFavorites.js",
"chars": 5210,
"preview": "/**\n * MerUserFavorites JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-21\n */\n\nvar MerUserFavorites"
},
{
"path": "resources/assets/static/js/backend/Simulator.js",
"chars": 14032,
"preview": "/**\n * 接口调试 JS\n *\n * @author Zix\n * @version 2.0 , 2016-09-13\n */\n\nvar Simulator = {\n config : {\n arrayCount : 0 ,\n"
},
{
"path": "resources/assets/static/js/backend/SimulatorReadme.js",
"chars": 292,
"preview": "/**\n * 模拟器文档 JS\n *\n * @author Zix\n * @version 2.0 , 2016-05-06\n */\n\nvar SimulatorReadme = {\n init : function () {\n "
},
{
"path": "resources/assets/static/js/backend/SysApiLog.js",
"chars": 5272,
"preview": "/**\n * SysApiLog JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2017-09-25\n */\n\nvar {funcLower} = {\n tok"
},
{
"path": "resources/assets/static/js/backend/SysAppVersion.js",
"chars": 6122,
"preview": "/**\n * SysAppVersion JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-27\n */\n\nvar SysAppVersion = {\n "
},
{
"path": "resources/assets/static/js/backend/SysArea.js",
"chars": 4836,
"preview": "/**\n * SysArea JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-20\n */\n\nvar SysArea = {\n\ttoken : $('i"
},
{
"path": "resources/assets/static/js/backend/SysFunc.js",
"chars": 5770,
"preview": "/**\n * SysFunc JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-12\n */\n\nvar SysFunc = {\n\n\t'token': $("
},
{
"path": "resources/assets/static/js/backend/SysMail.js",
"chars": 6794,
"preview": "/**\n * SysMail JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-10-10\n */\n\nvar SysMail = {\n token : $('"
},
{
"path": "resources/assets/static/js/backend/SysMerchant.js",
"chars": 7755,
"preview": "/**\n * SysMerchant JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-13\n */\n\nvar SysMerchant = {\n tok"
},
{
"path": "resources/assets/static/js/backend/SysMerchantDetail.js",
"chars": 297,
"preview": "/**\n * SysMerchant JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-28\n */\n\nvar SysMerchantDetail = {"
},
{
"path": "resources/assets/static/js/backend/SysPush.js",
"chars": 6446,
"preview": "/**\n * SysPush JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-19\n */\n\nvar SysPush = {\n\ttoken : $('i"
},
{
"path": "resources/assets/static/js/backend/SysRole.js",
"chars": 9627,
"preview": "/**\n * SysRole JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-12\n */\n\nvar SysRole = {\n\ttoken : $('i"
},
{
"path": "resources/assets/static/js/backend/SysSms.js",
"chars": 5101,
"preview": "/**\n * SysSms JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-18\n */\n\nvar SysSms = {\n\ttoken : $('inp"
},
{
"path": "resources/assets/static/js/backend/SysUser.js",
"chars": 7208,
"preview": "/**\n * SysUser JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-27\n */\n\nvar SysUser = {\n token: $('i"
},
{
"path": "resources/assets/static/js/global/app.js",
"chars": 29910,
"preview": "/**\n Core script to handle the entire theme and core functions\n **/\nvar App = function () {\n\n\t// IE mode\n\tvar isRTL = fa"
},
{
"path": "resources/assets/static/js/global/auth.js",
"chars": 1772,
"preview": "/**\n * Auth 页面 JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 2016-09-11\n */\n\nvar Auth = {\n\tinitLogin : funct"
},
{
"path": "resources/assets/static/js/global/layout.js",
"chars": 19610,
"preview": "/**\n Core script to handle the entire theme and core functions\n **/\nvar Layout = function () {\n\n\tvar layoutImgPath = 'la"
},
{
"path": "resources/assets/static/js/index/Articles.js",
"chars": 4590,
"preview": "var Articles = {\n config : {\n maxCommentLength : 250 ,\n curCommentLength : 0 ,\n tipTemplate : '可写 {len} 个字' ,\n"
},
{
"path": "resources/assets/static/js/index/Auth.js",
"chars": 4549,
"preview": "var Auth = {\n config : {\n bg : [\n 'static/themes/index/img/auth_1.jpg' ,\n 'static/themes/index/img/auth_2."
},
{
"path": "resources/assets/static/js/index/Index.js",
"chars": 5798,
"preview": "//渲染类型\nvar RenderType = {\n APPEND : 'append' , //添加\n REPLACE : 'replace' //替换\n};\n\nvar Index = {\n //页面配置文件\n config : "
},
{
"path": "resources/assets/static/js/index/Questions.js",
"chars": 12993,
"preview": "var Questions = {\n config : {\n mde : null,\n maxCommentLength : 250 ,\n curCommentLength : 0 ,\n tipTemplate :"
},
{
"path": "resources/assets/static/js/index/QuestionsCreate.js",
"chars": 1824,
"preview": "var QuestionsCreate = {\n config : {\n mde : null,\n } ,\n init : function () {\n\n this.initSendQuestion();\n this"
},
{
"path": "resources/assets/static/js/index/Users.js",
"chars": 44,
"preview": "var Users = {\n init : function () {\n\n }\n};"
},
{
"path": "resources/assets/static/js/mp/Index.js",
"chars": 1475,
"preview": "var Index = {\n\tinit : function(){\n\t\t// 指定图表的配置项和数据\n\t\tvar usersOption = {\n\t\t\ttooltip : {\n\t\t\t\ttrigger : 'axis'\n\t\t\t} ,\n\t\t\tl"
},
{
"path": "resources/assets/static/js/mp/MerAd.js",
"chars": 6299,
"preview": "/**\n * MerAd JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-16\n */\n\nvar MerAd = {\n\tconfig : {} ,\n\ti"
},
{
"path": "resources/assets/static/js/mp/MerAdCatalog.js",
"chars": 4778,
"preview": "/**\n * MerAdCatalog JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-16\n */\n\nvar MerAdCatalog = {\n c"
},
{
"path": "resources/assets/static/js/mp/MerArticles.js",
"chars": 8152,
"preview": "/**\n * MerArticles JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-14\n */\n\nvar MerArticles = {\n con"
},
{
"path": "resources/assets/static/js/mp/MerArticlesCatalog.js",
"chars": 4882,
"preview": "/**\n * MerArticlesCatalog JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-15\n */\n\nvar MerArticlesCat"
},
{
"path": "resources/assets/static/js/mp/MerGoods.js",
"chars": 15121,
"preview": "/**\n * MerGoods JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-10-11\n */\n\nvar MerGoods = {\n config : "
},
{
"path": "resources/assets/static/js/mp/MerGoodsCatalog.js",
"chars": 6726,
"preview": "/**\n * MerGoodsCatalog JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-10-11\n */\n\nvar MerGoodsCatalog ="
},
{
"path": "resources/assets/static/js/mp/MerOrder.js",
"chars": 8411,
"preview": "/**\n * MerOrder JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-18\n */\n\nvar MerOrder = {\n config : "
},
{
"path": "resources/assets/static/js/mp/MerUser.js",
"chars": 6644,
"preview": "/**\n * MerUser JS\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version 2.0 , 2016-09-16\n */\n\nvar MerUser = {\n\ttoken : $('i"
},
{
"path": "resources/assets/static/plugins/dmg-ui/AreaSelection.js",
"chars": 8383,
"preview": "/**\n * 区域选择\n *\n * @author Zix\n * @version 1.0 2016-05-18\n */\n\n;(function ($) {\n\n\tvar areaSelectionTmp =\n\t\t'<input id=\"ar"
},
{
"path": "resources/assets/static/plugins/dmg-ui/TableGrid.js",
"chars": 11909,
"preview": "/**\n * FIT Table Grid\n *\n * @author Zix\n * @version 2.0 , 2016-05-03\n */\n\n;(function ( $ ) {\n\n //保存数据\n //var fit_grid "
},
{
"path": "resources/assets/static/plugins/dmg-ui/TreeGrid.js",
"chars": 10455,
"preview": "/**\n * FIT Tree Grid\n *\n * @author Zix\n * @version 2.0 , 2016-05-06\n */\n\n;\n(function($) {\n\n\t//保存数据\n\t//var fit_tree_grid "
},
{
"path": "resources/assets/static/plugins/dmg-ui/Uploader.js",
"chars": 17471,
"preview": "/**\n *\n */\n\n;(function ( $ ) {\n\n var token = $('input[name=_token]').val();\n //var settings = {};\n var thisUploadObj "
},
{
"path": "resources/assets/static/plugins/dmg-ui/album.js",
"chars": 7316,
"preview": "/**\n *\n */\n\n;(function ($) {\n\n\tvar settings = {};\n\n\t//初始化页面\n\tvar _init_album = function ($this) {\n\t\tsettings = $this.dat"
},
{
"path": "resources/assets/static/plugins/dmg-ui/auto_fill.js",
"chars": 1851,
"preview": "(function($) {\n\tvar doFill = function( $this , data ) {\n\t\t//查询 下级全部含有 data-field 的 dom\n\t\t$this.find('div[data-field],tex"
},
{
"path": "resources/assets/static/plugins/dmg-ui/tiles.js",
"chars": 3894,
"preview": "/**\n * JQuery Tiles\n */\n\n;(function ($) {\n\n\t//初始化页面\n\tvar _init_tiles = function ($this) {\n\t\tvar settings = $this.data('t"
},
{
"path": "resources/assets/static/plugins/jquery-md5/jQuery.md5.js",
"chars": 9241,
"preview": "\t/**\n\t * jQuery MD5 hash algorithm function\n\t * \n\t * \t<code>\n\t * \t\tCalculate the md5 hash of a String \n\t * \t\tString $.md"
},
{
"path": "resources/assets/static/src/js/global/app.js",
"chars": 29723,
"preview": "/**\n Core script to handle the entire theme and core functions\n **/\nvar App = function () {\n\n\t// IE mode\n\tvar isRTL = fa"
},
{
"path": "resources/assets/static/src/js/global/custom.js",
"chars": 14215,
"preview": "/**\n * 自定义 JS 全局方法\n */\n\nvar xhrError = function ( XHR ) {\n tips.error( XHR.status + ' ' + XHR.statusText );\n};\n\n//toast"
},
{
"path": "resources/assets/static/src/js/global/format.js",
"chars": 2384,
"preview": "//******************************\n// data grid format function\n//******************************\n\n//edit button\nvar optEdi"
},
{
"path": "resources/assets/static/src/js/global/layout.js",
"chars": 20071,
"preview": "/**\n Core script to handle the entire theme and core functions\n **/\nvar Layout = function () {\n\n\tvar layoutImgPath = 'st"
},
{
"path": "resources/assets/static/src/themes/global/components-rounded.css",
"chars": 739437,
"preview": "/*********************************\n METRONIC ROUNDED STYLE COMPONENTS \n*********************************/\n/* Cubic Bezie"
},
{
"path": "resources/assets/static/src/themes/global/custom.css",
"chars": 5408,
"preview": "/*\n.page-logo {\n\tline-height: 75px;\n\tfont-size: 18px;\n}\n\n.page-logo a {\n\ttext-decoration:none ;\n}\n*/\n\n.back-btn-row {\n\tt"
},
{
"path": "resources/assets/static/src/themes/global/darkblue.css",
"chars": 40845,
"preview": "/* Cubic Bezier Transition */\n/*********** \n Page Header\n ***********/\n/* Header search bar, toggler button & top "
},
{
"path": "resources/assets/static/src/themes/global/error.css",
"chars": 2189,
"preview": "/* Cubic Bezier Transition */\n/***\nError Pages\n***/\n/* 404 page option #1 */\n.page-404 {\n text-align: center; }\n\n.page-"
},
{
"path": "resources/assets/static/src/themes/global/img/flags/readme.txt",
"chars": 507,
"preview": "Flag icons - http://www.famfamfam.com\n\nThese icons are public domain, and as such are free for any use (attribution appr"
},
{
"path": "resources/assets/static/src/themes/global/layout.css",
"chars": 98359,
"preview": "@charset \"UTF-8\";\n/* Cubic Bezier Transition */\n@media print {\n body {\n background-color: #fff !important; }\n .page"
},
{
"path": "resources/assets/static/src/themes/global/plugins.css",
"chars": 2432,
"preview": "@charset \"UTF-8\";\n/******************************\n 3RD PARTY PLUGIN CUSTOMIZATION\n******************************/\n/* Cub"
},
{
"path": "resources/assets/static/themes/global/login.css",
"chars": 2720,
"preview": "/* Cubic Bezier Transition */\n/***\nLogin page\n***/\n/* logo page */\n.login {\n background-color: #666 !important; }\n\n.log"
},
{
"path": "resources/assets/static/themes/index/app.css",
"chars": 4618,
"preview": "/** global start **/\nbody {\n\tfont-family: \"Open Sans\", sans-serif;\n\tfont-weight: 300;\n}\n\npre {\n\ttab-size: 4;\n\t-moz-tab-s"
},
{
"path": "resources/assets/static/themes/index/articles.css",
"chars": 121,
"preview": ".article-content {\n\tfont-size: 16px;\n\tline-height: 26px;\n\tpadding-bottom: 100px;\n}\n\n.article-content img {\n\twidth: 98%;\n"
},
{
"path": "resources/npm/package.json",
"chars": 1343,
"preview": "{\n \"name\": \"laravel-smart\",\n \"version\": \"1.0.0\",\n \"description\": \"smart + laravel\",\n \"main\": \"index.js\",\n \"scripts\""
},
{
"path": "resources/views/auth/login.blade.php",
"chars": 3053,
"preview": "@extends('layouts.app')\n\n@section('content')\n<div class=\"container\">\n <div class=\"row\">\n <div class=\"col-md-8 "
},
{
"path": "resources/views/auth/passwords/email.blade.php",
"chars": 1873,
"preview": "@extends('layouts.app')\n\n@section('content')\n<div class=\"container\">\n <div class=\"row\">\n <div class=\"col-md-8 "
},
{
"path": "resources/views/auth/passwords/reset.blade.php",
"chars": 3290,
"preview": "@extends('layouts.app')\n\n@section('content')\n<div class=\"container\">\n <div class=\"row\">\n <div class=\"col-md-8 "
},
{
"path": "resources/views/auth/register.blade.php",
"chars": 3517,
"preview": "@extends('layouts.app')\n\n@section('content')\n<div class=\"container\">\n <div class=\"row\">\n <div class=\"col-md-8 "
},
{
"path": "resources/views/generate/index.blade.php",
"chars": 18615,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n\n <!-- "
},
{
"path": "resources/views/home.blade.php",
"chars": 624,
"preview": "@extends('layouts.app')\n\n@section('content')\n<div class=\"container\">\n <div class=\"row\">\n <div class=\"col-md-8 "
},
{
"path": "resources/views/index/index.blade.php",
"chars": 4245,
"preview": "@extends('backend::public.layout')\n\n@section('content')\n\n\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-"
},
{
"path": "resources/views/layouts/app.blade.php",
"chars": 3281,
"preview": "<!DOCTYPE html>\n<html lang=\"{{ app()->getLocale() }}\">\n<head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Comp"
},
{
"path": "resources/views/meralbum/index.blade.php",
"chars": 7644,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT -->\n<div class=\"page-content-wrapper\">\n <di"
},
{
"path": "resources/views/meralbumcatalog/index.blade.php",
"chars": 3410,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT -->\n<div class=\"page-content-wrapper\">\n\t<div c"
},
{
"path": "resources/views/merfunc/index.blade.php",
"chars": 11328,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/mergoodscatalog/index.blade.php",
"chars": 8782,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/merrole/index.blade.php",
"chars": 8604,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/merrole/permission.blade.php",
"chars": 2280,
"preview": "\n<ul class=\"permission\">\n <?php foreach( $funcData as $row ) :?>\n <li class=\"func-tree\">\n <div class=\"func-"
},
{
"path": "resources/views/mersysuser/index.blade.php",
"chars": 7757,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/meruser/index.blade.php",
"chars": 8587,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/modulefunc/index.blade.php",
"chars": 10445,
"preview": "@extends('backend::public.layout')\n\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- "
},
{
"path": "resources/views/modulerole/index.blade.php",
"chars": 5643,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n\t<!-- BEGI"
},
{
"path": "resources/views/modulerole/permission.blade.php",
"chars": 1978,
"preview": "<ul class=\"permission\">\n <?php foreach( $funcData as $row ) :?>\n <li class=\"func-tree\">\n <div class=\"func-node\" dat"
},
{
"path": "resources/views/public/footer.blade.php",
"chars": 238,
"preview": "<div class=\"page-footer\">\n <div class=\"page-footer-inner\">\n 2016-2017 © Smart2 by Dark Matter Group.\n "
},
{
"path": "resources/views/public/header.blade.php",
"chars": 2910,
"preview": "\n<div class=\"page-header navbar navbar-fixed-top\">\n <!-- BEGIN HEADER INNER -->\n <div class=\"page-header-inner \">\n"
},
{
"path": "resources/views/public/layout.blade.php",
"chars": 5327,
"preview": "\n<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"I"
},
{
"path": "resources/views/public/layout1.blade.php",
"chars": 5270,
"preview": "<!DOCTYPE html>\n<html lang=\"zh-CN\">\n<head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE"
},
{
"path": "resources/views/public/sidebar_menu.blade.php",
"chars": 2299,
"preview": "<!-- BEGIN SIDEBAR MENU -->\n<ul style=\"padding-top: 20px\" data-slide-speed=\"200\"\n data-auto-scroll=\"true\" data-keep-e"
},
{
"path": "resources/views/simulator/index.blade.php",
"chars": 8334,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n<!-- BEGIN"
},
{
"path": "resources/views/simulator/params.blade.php",
"chars": 3500,
"preview": "<form id=\"requestMethodForm\" class=\"form-horizontal\">\n <div class=\"form-body\">\n <!-- start item -->\n <d"
},
{
"path": "resources/views/sysapilog/index.blade.php",
"chars": 5320,
"preview": "@extend('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n{!! csrf_field() !!}\n<div class=\"page-"
},
{
"path": "resources/views/sysappversion/index.blade.php",
"chars": 8163,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/sysarea/index.blade.php",
"chars": 5735,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/sysfunc/index.blade.php",
"chars": 9865,
"preview": "@extends('backend::public.layout')\n\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- "
},
{
"path": "resources/views/sysmail/index.blade.php",
"chars": 8754,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/sysmerchant/detail.blade.php",
"chars": 2745,
"preview": "@extends('backend::public.layout')\n@section('content')\n<div class=\"page-content\">\n <!-- BEGIN PAGE BAR -->\n <div c"
},
{
"path": "resources/views/sysmerchant/index.blade.php",
"chars": 10513,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/sysmodules/index.blade.php",
"chars": 6064,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n{!! csrf_field() !!}\n<div class=\"page"
},
{
"path": "resources/views/sysmodules/role.blade.php",
"chars": 5082,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n\t<!-- BEGI"
},
{
"path": "resources/views/syspush/index.blade.php",
"chars": 9945,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/sysrole/index.blade.php",
"chars": 5082,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n\t<!-- BEGI"
},
{
"path": "resources/views/sysrole/permission.blade.php",
"chars": 1978,
"preview": "<ul class=\"permission\">\n <?php foreach( $funcData as $row ) :?>\n <li class=\"func-tree\">\n <div class=\"func-node\" dat"
},
{
"path": "resources/views/syssettings/index.blade.php",
"chars": 5029,
"preview": "@extends('Backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n{!! csrf_field() !!}\n<div class=\"page"
},
{
"path": "resources/views/syssettings/sms.blade.php",
"chars": 1114,
"preview": "@extends('Backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n{!! csrf_field() !!}\n<div class=\"page"
},
{
"path": "resources/views/syssms/index.blade.php",
"chars": 7363,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/sysuser/index.blade.php",
"chars": 8056,
"preview": "@extends('backend::public.layout')\n@section('content')\n<!-- BEGIN CONTENT BODY -->\n<div class=\"page-content\">\n <!-- B"
},
{
"path": "resources/views/welcome.blade.php",
"chars": 2736,
"preview": "<!doctype html>\n<html lang=\"{{ app()->getLocale() }}\">\n <head>\n <meta charset=\"utf-8\">\n <meta http-equi"
},
{
"path": "resources/views/widget/Checkbox.blade.php",
"chars": 0,
"preview": ""
},
{
"path": "resources/views/widget/File.blade.php",
"chars": 0,
"preview": ""
},
{
"path": "resources/views/widget/Hidden.blade.php",
"chars": 0,
"preview": ""
},
{
"path": "resources/views/widget/Image.blade.php",
"chars": 0,
"preview": ""
},
{
"path": "resources/views/widget/Radio.blade.php",
"chars": 322,
"preview": "<div class=\"form-group\">\n\t<label class=\"col-md-3 control-label\">{{ $title }}</label>\n\t<div class=\"col-md-7\">\n\n\t\t@foreach"
},
{
"path": "resources/views/widget/Text.blade.php",
"chars": 389,
"preview": "<div class=\"form-group\">\n <label class=\"col-md-2 control-label\">{{ $title }}}</label>\n <div class=\"col-md-6\">\n "
},
{
"path": "resources/views/widget/Textarea.blade.php",
"chars": 0,
"preview": ""
},
{
"path": "router/routes.php",
"chars": 11445,
"preview": "<?php\n\nuse Illuminate\\Routing\\Router;\nRoute::group([\n 'prefix'=>strtolower('Backend' ),\n 'namespace' => 'Smart\\\\Co"
},
{
"path": "src/Auth/Database/seeds/AdminTableSeeder.php",
"chars": 4146,
"preview": "<?php\nnamespace Smart\\Auth\\Database;\n\nuse Illuminate\\Database\\Seeder;\nuse Illuminate\\Support\\Carbon;\nuse Illuminate\\Supp"
},
{
"path": "src/Console/InstallCommand.php",
"chars": 5380,
"preview": "<?php\n\nnamespace Smart\\Console\\Commands;\n\nuse Illuminate\\Console\\Command;\nuse Smart\\Auth\\Database\\AdminTableSeeder;\nuse "
},
{
"path": "src/Console/UninstallCommand.php",
"chars": 985,
"preview": "<?php\n\nnamespace Smart\\Console\\Commands;\n\nuse Illuminate\\Console\\Command;\n\nclass UninstallCommand extends Command {\n\t/**"
},
{
"path": "src/Controllers/Backend/AuthController.php",
"chars": 777,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/16\n * Time: 13:31\n */\n\nnamespace S"
},
{
"path": "src/Controllers/Backend/Backend.php",
"chars": 1428,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: sl\n * Date: 2017/9/14\n * Time: 09:45\n */\nnamespace Smart\\Controllers\\Backend;"
},
{
"path": "src/Controllers/Backend/Generate.php",
"chars": 2984,
"preview": "<?php\n/**\n * 代码生成 Controller\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/25\n * Time: 14:45\n */\n\nnamespace Smart\\"
},
{
"path": "src/Controllers/Backend/Index.php",
"chars": 2062,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: sl\n * Date: 2017/9/14\n * Time: 10:18\n */\nnamespace Smart\\Controllers\\Backend;"
},
{
"path": "src/Controllers/Backend/MerAlbum.php",
"chars": 3567,
"preview": "<?php namespace Smart\\Controllers\\Backend;\n/**\n * MerAlbum Controller\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version"
},
{
"path": "src/Controllers/Backend/MerAlbumCatalog.php",
"chars": 2456,
"preview": "<?php namespace Smart\\Controllers\\Backend;\n/**\n * MerAlbumCatalog Controller\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @"
},
{
"path": "src/Controllers/Backend/MerAlbumTag.php",
"chars": 1799,
"preview": "<?php namespace Smart\\Controllers\\Backend;\n/**\n * MerAlbumTag Controller\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @vers"
},
{
"path": "src/Controllers/Backend/MerFunc.php",
"chars": 3348,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/21\n * Time: 15:49\n */\n\nnamespace S"
},
{
"path": "src/Controllers/Backend/MerGoodsCatalog.php",
"chars": 2676,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/21\n * Time: 09:33\n */\n\nnamespace S"
},
{
"path": "src/Controllers/Backend/MerRole.php",
"chars": 4558,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/21\n * Time: 15:49\n */\n namespace S"
},
{
"path": "src/Controllers/Backend/MerSysUser.php",
"chars": 4521,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/21\n * Time: 13:31\n */\n\nnamespace S"
},
{
"path": "src/Controllers/Backend/MerUser.php",
"chars": 4435,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/16\n * Time: 13:31\n */\n\nnamespace S"
},
{
"path": "src/Controllers/Backend/ModuleFunc.php",
"chars": 2476,
"preview": "<?php namespace Smart\\Controllers\\Backend;\n/**\n * SysFunc Controller\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @version "
},
{
"path": "src/Controllers/Backend/ModuleRole.php",
"chars": 3660,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: sl\n * Date: 2017/9/14\n * Time: 10:18\n */\nnamespace Smart\\Controllers\\Backend;"
},
{
"path": "src/Controllers/Backend/Simulator.php",
"chars": 4060,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/18\n * Time: 16:41\n */\n\nnamespace S"
},
{
"path": "src/Controllers/Backend/SysApiLog.php",
"chars": 1723,
"preview": "<?php namespace Smart\\Controllers\\Backend;\n/**\n * SysApiLog Controller\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @versio"
},
{
"path": "src/Controllers/Backend/SysAppVersion.php",
"chars": 2067,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/22\n * Time: 16:55\n */\n\nnamespace S"
},
{
"path": "src/Controllers/Backend/SysArea.php",
"chars": 2310,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/18\n * Time: 15:29\n */\nnamespace Sm"
},
{
"path": "src/Controllers/Backend/SysBase.php",
"chars": 9169,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: sl\n * Date: 2017/9/14\n * Time: 09:49\n */\nnamespace Smart\\Controllers\\Backend;"
},
{
"path": "src/Controllers/Backend/SysFunc.php",
"chars": 2334,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: sl\n * Date: 2017/9/14\n * Time: 10:18\n */\nnamespace Smart\\Controllers\\Backend;"
},
{
"path": "src/Controllers/Backend/SysMail.php",
"chars": 2216,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/25\n * Time: 14:22\n */\nnamespace Sm"
},
{
"path": "src/Controllers/Backend/SysMerchant.php",
"chars": 3676,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/18\n * Time: 17:40\n */\nnamespace Sm"
},
{
"path": "src/Controllers/Backend/SysModule.php",
"chars": 1747,
"preview": "<?php\nnamespace Smart\\Controllers\\Backend;\n/**\n * SysModule Controller\n *\n * @author MR.Z <zsh2088@gmail.com>\n * @versio"
},
{
"path": "src/Controllers/Backend/SysPush.php",
"chars": 2275,
"preview": "<?php\n/**\n * Created by PhpStorm.\n * User: MR.Z < zsh2088@gmail.com >\n * Date: 2017/9/22\n * Time: 17:20\n */\n namespace S"
}
]
// ... and 152 more files (download for full content)
About this extraction
This page contains the full source code of the dominator88/laravel-smart GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 352 files (1.9 MB), approximately 545.0k tokens, and a symbol index with 711 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.