作者 开飞机的舒克

后台修改

... ... @@ -3,6 +3,7 @@
namespace app\admin\controller;
use app\common\controller\Backend;
use app\common\controller\Resource;
/**
* 学生管理
... ... @@ -69,6 +70,21 @@ class Study extends Backend
return $this->view->fetch();
}
/**
* 生成现场二维码
*/
public function barcode($ids)
{
$barcode = $this->model->where('id', $ids)->value('barcode');
if (!empty($barcode)) {
$this->error('已生成二维码,无需重复生成');
}
$brpath = Resource::StudyBar($ids);
$this->model->save(['qrcode' => $brpath], ['id' => $ids]);
$this->success('操作成功');
}
//导出数据
public function export()
{
... ...
<?php
namespace app\common\controller;
use tinymeng\code\Generate;
class Resource
{
/**
*
*/
public static function StudyBar($id){
$generate = Generate::bar();
/** 二维码存入本地并输出存储路径 */
$file_path = $generate->create($id,true);
$file_path = substr($file_path,strripos($file_path,"public")+6);
return $file_path;
}
}
\ No newline at end of file
... ...
... ... @@ -31,8 +31,8 @@
"ext-pdo": "*",
"ext-bcmath": "*",
"txthinking/mailer": "^2.0",
"chenbool/barcode": "^1.0",
"phpoffice/phpexcel": "^1.8"
"phpoffice/phpexcel": "^1.8",
"tinymeng/code": "^2.0"
},
"config": {
"preferred-install": "dist",
... ...
... ... @@ -99,7 +99,25 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'barcode', title: __('Barcode'), operate:false},
// {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
// {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
buttons: [
{
name: 'qrcode',
title: __('生成条形码'),
classname: 'btn btn-xs btn-primary btn-ajax',
icon: 'fa fa-qrcode',
url: 'study/barcode',
confirm: '确认生成新的条形码吗',
success: function (data, ret) {
return data;
},
error: function (data, ret) {
Toastr.error(ret.msg);
return false;
}
}
],
formatter: Table.api.formatter.operate}
]
]
});
... ...
... ... @@ -6,11 +6,12 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'tinymeng\\tools\\' => array($vendorDir . '/tinymeng/tools/src'),
'tinymeng\\code\\' => array($vendorDir . '/tinymeng/code/src'),
'think\\helper\\' => array($vendorDir . '/topthink/think-helper/src'),
'think\\composer\\' => array($vendorDir . '/topthink/think-installer/src'),
'think\\captcha\\' => array($vendorDir . '/topthink/think-captcha/src'),
'think\\' => array($vendorDir . '/karsonzhang/fastadmin-addons/src', $baseDir . '/thinkphp/library/think', $vendorDir . '/topthink/think-queue/src'),
'chenbool\\' => array($vendorDir . '/chenbool/barcode/src'),
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
'Tx\\' => array($vendorDir . '/txthinking/mailer/src'),
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
... ...
... ... @@ -26,15 +26,13 @@ class ComposerStaticInit73f9e72fede2c36621e52f7b610bbb65
public static $prefixLengthsPsr4 = array (
't' =>
array (
'tinymeng\\tools\\' => 15,
'tinymeng\\code\\' => 14,
'think\\helper\\' => 13,
'think\\composer\\' => 15,
'think\\captcha\\' => 14,
'think\\' => 6,
),
'c' =>
array (
'chenbool\\' => 9,
),
'Z' =>
array (
'ZipStream\\' => 10,
... ... @@ -99,6 +97,14 @@ class ComposerStaticInit73f9e72fede2c36621e52f7b610bbb65
);
public static $prefixDirsPsr4 = array (
'tinymeng\\tools\\' =>
array (
0 => __DIR__ . '/..' . '/tinymeng/tools/src',
),
'tinymeng\\code\\' =>
array (
0 => __DIR__ . '/..' . '/tinymeng/code/src',
),
'think\\helper\\' =>
array (
0 => __DIR__ . '/..' . '/topthink/think-helper/src',
... ... @@ -117,10 +123,6 @@ class ComposerStaticInit73f9e72fede2c36621e52f7b610bbb65
1 => __DIR__ . '/../..' . '/thinkphp/library/think',
2 => __DIR__ . '/..' . '/topthink/think-queue/src',
),
'chenbool\\' =>
array (
0 => __DIR__ . '/..' . '/chenbool/barcode/src',
),
'ZipStream\\' =>
array (
0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src',
... ...
{
"packages": [
{
"name": "chenbool/barcode",
"version": "1.0.0",
"version_normalized": "1.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/chenbool/barcode.git",
"reference": "4c1b8264527e8e53bfb059696d60c4e31fd63e24"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chenbool/barcode/zipball/4c1b8264527e8e53bfb059696d60c4e31fd63e24",
"reference": "4c1b8264527e8e53bfb059696d60c4e31fd63e24",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2019-07-31T09:34:38+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"chenbool\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "chenbool",
"email": "30024167@qq.com",
"homepage": "https://github.com/chenbool"
}
],
"description": "一个简单的条形码生成插件",
"homepage": "https://github.com/chenbool",
"keywords": [
"qrcode",
"二维码"
],
"support": {
"issues": "https://github.com/chenbool/barcode/issues",
"source": "https://github.com/chenbool/barcode/tree/1.0.0"
},
"install-path": "../chenbool/barcode"
},
{
"name": "easywechat-composer/easywechat-composer",
"version": "1.4.1",
"version_normalized": "1.4.1.0",
... ... @@ -3014,6 +2965,107 @@
"install-path": "../symfony/var-exporter"
},
{
"name": "tinymeng/code",
"version": "v2.0.1",
"version_normalized": "2.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/majiameng/phpQrCode.git",
"reference": "a5a6ba189f18a8e1f826dfa4994e26da5714d8ad"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/majiameng/phpQrCode/zipball/a5a6ba189f18a8e1f826dfa4994e26da5714d8ad",
"reference": "a5a6ba189f18a8e1f826dfa4994e26da5714d8ad",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"tinymeng/tools": "^1.0.7"
},
"time": "2020-03-28T10:11:51+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"tinymeng\\code\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "TinyMeng",
"email": "666@majiameng.com",
"homepage": "https://majiameng.com"
}
],
"description": "php生成条形码或者二维码QRcode",
"keywords": [
"code",
"qrcode",
"tinymeng"
],
"support": {
"issues": "https://github.com/majiameng/phpQrCode/issues",
"source": "https://github.com/majiameng/phpQrCode/tree/v2.0.1"
},
"install-path": "../tinymeng/code"
},
{
"name": "tinymeng/tools",
"version": "v1.2.4",
"version_normalized": "1.2.4.0",
"source": {
"type": "git",
"url": "https://github.com/majiameng/tools.git",
"reference": "a16c4b550e9fbede32159779a4507cd97133208b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/majiameng/tools/zipball/a16c4b550e9fbede32159779a4507cd97133208b",
"reference": "a16c4b550e9fbede32159779a4507cd97133208b",
"shasum": ""
},
"require": {
"php": ">=7.0.0"
},
"time": "2023-02-10T04:56:10+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"files": [],
"psr-4": {
"tinymeng\\tools\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "JiaMeng Ma",
"email": "666@majiameng.com",
"homepage": "http://majiameng.com"
}
],
"description": "Integrate third-party logins",
"keywords": [
"php",
"php-tools",
"tinymeng",
"tools"
],
"support": {
"issues": "https://github.com/majiameng/tools/issues",
"source": "https://github.com/majiameng/tools/tree/v1.2.4"
},
"install-path": "../tinymeng/tools"
},
{
"name": "topthink/framework",
"version": "dev-master",
"version_normalized": "dev-master",
... ...
... ... @@ -3,22 +3,13 @@
'name' => 'karsonzhang/fastadmin',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '9a8361a29c430477d49b4eccbb24941b30610f16',
'reference' => '0f0ef558f4db0a4fde56b14198cdf8e8431c82ba',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'chenbool/barcode' => array(
'pretty_version' => '1.0.0',
'version' => '1.0.0.0',
'reference' => '4c1b8264527e8e53bfb059696d60c4e31fd63e24',
'type' => 'library',
'install_path' => __DIR__ . '/../chenbool/barcode',
'aliases' => array(),
'dev_requirement' => false,
),
'easywechat-composer/easywechat-composer' => array(
'pretty_version' => '1.4.1',
'version' => '1.4.1.0',
... ... @@ -67,7 +58,7 @@
'karsonzhang/fastadmin' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '9a8361a29c430477d49b4eccbb24941b30610f16',
'reference' => '0f0ef558f4db0a4fde56b14198cdf8e8431c82ba',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
... ... @@ -451,6 +442,24 @@
'aliases' => array(),
'dev_requirement' => false,
),
'tinymeng/code' => array(
'pretty_version' => 'v2.0.1',
'version' => '2.0.1.0',
'reference' => 'a5a6ba189f18a8e1f826dfa4994e26da5714d8ad',
'type' => 'library',
'install_path' => __DIR__ . '/../tinymeng/code',
'aliases' => array(),
'dev_requirement' => false,
),
'tinymeng/tools' => array(
'pretty_version' => 'v1.2.4',
'version' => '1.2.4.0',
'reference' => 'a16c4b550e9fbede32159779a4507cd97133208b',
'type' => 'library',
'install_path' => __DIR__ . '/../tinymeng/tools',
'aliases' => array(),
'dev_requirement' => false,
),
'topthink/framework' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
... ...