Commit c7b03ea4 by 孙龙

订单列表

parent 53aaa2c7
......@@ -12,13 +12,13 @@ use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Widgets\Box;
use Dcat\Admin\Widgets\Dropdown;
class OrderController extends AdminController
{
protected $tian = ['甲', '乙', '丙', '丁', '戊', '己'];
/**
* Index interface.
......@@ -83,6 +83,7 @@ class OrderController extends AdminController
$grid->showFilter();
$grid->filter(function (Grid\Filter $filter) {
$filter->expand(true);
......@@ -124,17 +125,13 @@ class OrderController extends AdminController
$rowArray = $actions->row->toArray();
// 获取当前行主键值
$id = $actions->getKey();
//取消按钮
$actions->append(new OrderCancelAction());
// $actions->prepend('<a href="">取消</a>');
// $actions->prepend(
// Dropdown::make()
// ->button('下载') ->buttonClass('btn btn-primary') // 设置按钮样式
// ->options([
// 'PI',
// 'CI',
// ]));
//下载
$actions->prepend(
\App\Admin\Controllers\OrderController::down($id)
);
});
......@@ -145,6 +142,38 @@ class OrderController extends AdminController
}
public static function down($id){
$menu1 = Dropdown::make()
->button('下载')
->buttonClass('btn btn-primary btn-sm btn-mini') // 设置按钮样式
->options([
'PI',
'CI',
'PL',
])->map(function ($v, $k) use($id) {
$k++;
return "<a style='min-width: 5rem' class='test_item' data-orderid='$id' data-id='$k', data-value='{$v}' data-test='Hello world.' href='javascript:void(0)'>$v</a>";
});
\Dcat\Admin\Admin::style(
<<<style
.dropdown .dropdown-menu {min-width: 5rem;}
style
);
\Dcat\Admin\Admin::script(
<<<JS
$('.test_item').click(function () {
console.log($(this).data().id);
window.location.href="/admin/api/order_download?type="+$(this).data().id+"&order_id="+$(this).data().orderid
});
JS
);
return $menu1;
}
/**
* Make a show builder.
*
......
......@@ -6,6 +6,8 @@ use Dcat\Admin\Admin;
Admin::routes();
Route::group([
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace'),
......@@ -18,4 +20,10 @@ Route::group([
$router->resource('order', 'OrderController');
$router->resource('test', 'TestController');
$router->resource('users', 'UserController');
//下载pdf
Route::get('/api/order_download', '\App\Admin\Controllers\Api\OrderApiController@orderDownload');
});
......@@ -4,6 +4,8 @@ namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Dcat\Admin\Widgets\Box;
use Dcat\Admin\Widgets\Dropdown;
use Illuminate\Database\Eloquent\Model;
class Order extends Model
......@@ -32,4 +34,6 @@ class Order extends Model
public static function auditOrder($orderIds=[]){
return self::whereIn("order_id",$orderIds)->where("status",self::$STATUS_WAIT_AUDIT)->update(["status"=>self::$STATUS_WAIT_PAY]);
}
}
......@@ -9,14 +9,15 @@
"license": "MIT",
"require": {
"php": "^7.2.5|^8.0",
"ext-json": "*",
"dcat/laravel-admin": "2.*",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^6.3.1|^7.0.1",
"laravel/framework": "^7.29",
"laravel/tinker": "^2.5",
"mosiboom/dcat-iframe-tab": "^1.2",
"ext-json": "*"
"maatwebsite/excel": "^3.1",
"mosiboom/dcat-iframe-tab": "^1.2"
},
"require-dev": {
"facade/ignition": "^2.0",
......
......@@ -17,3 +17,7 @@ use Illuminate\Support\Facades\Route;
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
......@@ -24,8 +24,21 @@ use Composer\Semver\VersionParser;
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
*/
private static $installedByVendor = array();
/**
......
This diff could not be displayed because it is too large.
......@@ -17,8 +17,8 @@ return array(
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php',
'2c102faa651ef8ea5874edb585946bce' => $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php',
'801c31d8ed748cfa537fa45402288c95' => $vendorDir . '/psy/psysh/src/functions.php',
'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php',
......@@ -26,6 +26,7 @@ return array(
'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php',
'f0906e6318348a765ffb6eb24e0d0938' => $vendorDir . '/laravel/framework/src/Illuminate/Foundation/helpers.php',
'58571171fd5812e6e447dce228f52f4d' => $vendorDir . '/laravel/framework/src/Illuminate/Support/helpers.php',
'2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php',
'9cdd7b9056abc3081735233ba9dd9c7f' => $vendorDir . '/facade/flare-client-php/src/helpers.php',
'b6ec61354e97f32c0ae683041c78392a' => $vendorDir . '/scrivo/highlight.php/HighlightUtilities/functions.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
......
......@@ -9,4 +9,5 @@ return array(
'Mockery' => array($vendorDir . '/mockery/mockery/library'),
'Highlight\\' => array($vendorDir . '/scrivo/highlight.php'),
'HighlightUtilities\\' => array($vendorDir . '/scrivo/highlight.php'),
'HTMLPurifier' => array($vendorDir . '/ezyang/htmlpurifier/library'),
);
......@@ -7,6 +7,7 @@ $baseDir = dirname($vendorDir);
return array(
'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'),
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
'Whoops\\' => array($vendorDir . '/filp/whoops/src/Whoops'),
'TijsVerkoyen\\CssToInlineStyles\\' => array($vendorDir . '/tijsverkoyen/css-to-inline-styles/src'),
'Tests\\' => array($baseDir . '/tests'),
......@@ -47,10 +48,14 @@ return array(
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
'PhpParser\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),
'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'),
'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
'Opis\\Closure\\' => array($vendorDir . '/opis/closure/src'),
'NunoMaduro\\Collision\\' => array($vendorDir . '/nunomaduro/collision/src'),
'MyCLabs\\Enum\\' => array($vendorDir . '/myclabs/php-enum/src'),
'Mosiboom\\DcatIframeTab\\' => array($vendorDir . '/mosiboom/dcat-iframe-tab/src'),
'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
'Maatwebsite\\Excel\\' => array($vendorDir . '/maatwebsite/excel/src'),
'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'),
'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'),
'League\\CommonMark\\' => array($vendorDir . '/league/commonmark/src'),
......@@ -77,6 +82,7 @@ return array(
'DeepCopy\\' => array($vendorDir . '/myclabs/deep-copy/src/DeepCopy'),
'Dcat\\Admin\\' => array($vendorDir . '/dcat/laravel-admin/src'),
'Cron\\' => array($vendorDir . '/dragonmantank/cron-expression/src/Cron'),
'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
'Brick\\Math\\' => array($vendorDir . '/brick/math/src'),
'Asm89\\Stack\\' => array($vendorDir . '/asm89/stack-cors/src'),
......
This diff could not be displayed because it is too large.
......@@ -5,7 +5,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '89836defef5142f322d286ae9b11193431e5322f',
'reference' => '53aaa2c7f6b9feb9644bec2242af0eab7d60b49b',
'name' => 'laravel/laravel',
'dev' => true,
),
......@@ -130,6 +130,15 @@
'reference' => '0dbf5d78455d4d6a41d186da50adc1122ec066f4',
'dev_requirement' => false,
),
'ezyang/htmlpurifier' => array(
'pretty_version' => 'v4.16.0',
'version' => '4.16.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../ezyang/htmlpurifier',
'aliases' => array(),
'reference' => '523407fb06eb9e5f3d59889b3978d5bfe94299c8',
'dev_requirement' => false,
),
'facade/flare-client-php' => array(
'pretty_version' => '1.10.0',
'version' => '1.10.0.0',
......@@ -424,7 +433,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '89836defef5142f322d286ae9b11193431e5322f',
'reference' => '53aaa2c7f6b9feb9644bec2242af0eab7d60b49b',
'dev_requirement' => false,
),
'laravel/tinker' => array(
......@@ -463,6 +472,42 @@
'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd',
'dev_requirement' => false,
),
'maatwebsite/excel' => array(
'pretty_version' => '3.1.43',
'version' => '3.1.43.0',
'type' => 'library',
'install_path' => __DIR__ . '/../maatwebsite/excel',
'aliases' => array(),
'reference' => '3c5b95478fb6f76b9a6ab527d54afbb3afbda611',
'dev_requirement' => false,
),
'maennchen/zipstream-php' => array(
'pretty_version' => '2.1.0',
'version' => '2.1.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../maennchen/zipstream-php',
'aliases' => array(),
'reference' => 'c4c5803cc1f93df3d2448478ef79394a5981cc58',
'dev_requirement' => false,
),
'markbaker/complex' => array(
'pretty_version' => '3.0.1',
'version' => '3.0.1.0',
'type' => 'library',
'install_path' => __DIR__ . '/../markbaker/complex',
'aliases' => array(),
'reference' => 'ab8bc271e404909db09ff2d5ffa1e538085c0f22',
'dev_requirement' => false,
),
'markbaker/matrix' => array(
'pretty_version' => '3.0.0',
'version' => '3.0.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../markbaker/matrix',
'aliases' => array(),
'reference' => 'c66aefcafb4f6c269510e9ac46b82619a904c576',
'dev_requirement' => false,
),
'mockery/mockery' => array(
'pretty_version' => '1.3.6',
'version' => '1.3.6.0',
......@@ -499,6 +544,15 @@
'reference' => '14daed4296fae74d9e3201d2c4925d1acb7aa614',
'dev_requirement' => true,
),
'myclabs/php-enum' => array(
'pretty_version' => '1.8.3',
'version' => '1.8.3.0',
'type' => 'library',
'install_path' => __DIR__ . '/../myclabs/php-enum',
'aliases' => array(),
'reference' => 'b942d263c641ddb5190929ff840c68f78713e937',
'dev_requirement' => false,
),
'nesbot/carbon' => array(
'pretty_version' => '2.62.1',
'version' => '2.62.1.0',
......@@ -553,6 +607,15 @@
'reference' => '4f7fd7836c6f332bb2933569e566a0d6c4cbed74',
'dev_requirement' => true,
),
'phpoffice/phpspreadsheet' => array(
'pretty_version' => '1.25.2',
'version' => '1.25.2.0',
'type' => 'library',
'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
'aliases' => array(),
'reference' => 'a317a09e7def49852400a4b3eca4a4b0790ceeb5',
'dev_requirement' => false,
),
'phpoption/phpoption' => array(
'pretty_version' => '1.8.1',
'version' => '1.8.1.0',
......
......@@ -4,8 +4,8 @@
$issues = array();
if (!(PHP_VERSION_ID >= 70205)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.';
if (!(PHP_VERSION_ID >= 70300)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment