优化代码
This commit is contained in:
parent
af7198c7de
commit
19ae57b71e
|
|
@ -21,7 +21,6 @@ class Upload extends Base
|
|||
{
|
||||
|
||||
$config = getConfig('uploads');
|
||||
|
||||
$this->uploader = new TencentCosUploader($config);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,9 @@ class User extends Base
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
if(empty($value['mobile'])){
|
||||
$value['mobile'] ='未绑定';
|
||||
}
|
||||
$value['user_hegui'] = $user_hegui;
|
||||
$value['user_all_total'] = $user_all_total;
|
||||
$value['user_weixin_total'] = $user_weixin_total;
|
||||
|
|
@ -111,21 +113,6 @@ class User extends Base
|
|||
|
||||
$count = $data['count'];
|
||||
|
||||
// 处理数据
|
||||
foreach ($list as &$item) {
|
||||
$item['headimg'] = imageUrl($item['headimg']);
|
||||
// 格式化余额为两位小数
|
||||
$item['money'] = number_format($item['money'], 2, '.', '');
|
||||
|
||||
// 格式化吧唧币为两位小数
|
||||
$item['integral'] = number_format($item['integral'], 2, '.', '');
|
||||
|
||||
// 格式化积分为两位小数
|
||||
$item['score'] = number_format($item['score'], 2, '.', '');
|
||||
|
||||
// 格式化盒柜价值为两位小数
|
||||
$item['user_hegui'] = number_format($item['user_hegui'], 2, '.', '');
|
||||
}
|
||||
|
||||
return json([
|
||||
'code' => 0,
|
||||
|
|
|
|||
|
|
@ -554,9 +554,6 @@
|
|||
padding: 0px 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.layui-table thead th {
|
||||
height: 30px !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,22 +3,11 @@
|
|||
namespace app\common\server;
|
||||
|
||||
use think\Image;
|
||||
use dh2y\qrcode\QRcode;
|
||||
|
||||
class Qcode
|
||||
{
|
||||
|
||||
/**
|
||||
* 生成二维码
|
||||
* @return void
|
||||
* @author: k
|
||||
* @time: 2023-05-09 16:49
|
||||
*/
|
||||
public function setCode($url, $save_path)
|
||||
{
|
||||
$code = new QRcode();//创建二维码对象,必须得。因为这是面向对象思想,我写代码,写出一个二维码对象,二维码对象操作。也就是说我控制二维码对象来操作里面的变量方法.
|
||||
$code->png($url, $save_path, 8)->entry();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 带背景的二维码
|
||||
|
|
@ -33,32 +22,6 @@ class Qcode
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成带文字的二维码
|
||||
* @param $codePath 二维码路径
|
||||
* @param $parameter 文字
|
||||
* @return mixed
|
||||
*/
|
||||
public function BgCodeImage($codePath = '', $parameter = '', $x = 0, $y = 0)
|
||||
{
|
||||
require_once('../vendor/topthink/think-image/src/Image.php');
|
||||
|
||||
$wwwpath = dirname($_SERVER['SCRIPT_FILENAME']) . '/';
|
||||
$newCodePath = $wwwpath . $codePath;//二维码路径
|
||||
// #新图片路径
|
||||
// $new_path = 'storage/share/';
|
||||
// #完整图片路径
|
||||
// $new_save_path = $wwwpath . $new_path;
|
||||
// if (!file_exists($new_save_path)) {
|
||||
// mkdir($new_save_path);
|
||||
// }
|
||||
// $new_path_name = md5(md5(time() . rand(100000, 999999)) . md5(time())) . '.png';
|
||||
// $new_share_code = $new_save_path . $new_path_name;
|
||||
$image = Image::open($newCodePath);
|
||||
$font = $wwwpath . 'static/image/ziti.ttf';
|
||||
$image->text($parameter, $font, 26, '#FF6A06', [$x, $y])->save($newCodePath);
|
||||
return $codePath;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user