Compare commits

..

No commits in common. "master" and "develop" have entirely different histories.

23 changed files with 419 additions and 1312 deletions

93
README.md Executable file
View File

@ -0,0 +1,93 @@
FastAdmin是一款基于ThinkPHP+Bootstrap的极速后台开发框架。
## 主要特性
* 基于`Auth`验证的权限管理系统
* 支持无限级父子级权限继承,父级的管理员可任意增删改子级管理员及权限设置
* 支持单管理员多角色
* 支持管理子级数据或个人数据
* 强大的一键生成功能
* 一键生成CRUD,包括控制器、模型、视图、JS、语言包、菜单、回收站等
* 一键压缩打包JS和CSS文件一键CDN静态资源部署
* 一键生成控制器菜单和规则
* 一键生成API接口文档
* 完善的前端功能组件开发
* 基于`AdminLTE`二次开发
* 基于`Bootstrap`开发自适应手机、平板、PC
* 基于`RequireJS`进行JS模块管理按需加载
* 基于`Less`进行样式开发
* 强大的插件扩展功能,在线安装卸载升级插件
* 通用的会员模块和API模块
* 共用同一账号体系的Web端会员中心权限验证和API接口会员权限验证
* 二级域名部署支持,同时域名支持绑定到应用插件
* 多语言支持,服务端及客户端支持
* 支持大文件分片上传、剪切板粘贴上传、拖拽上传,进度条显示,图片上传前压缩
* 支持表格固定列、固定表头、跨页选择、Excel导出、模板渲染等功能
* 强大的第三方应用模块支持([CMS](https://www.fastadmin.net/store/cms.html)、[CRM](https://www.fastadmin.net/store/facrm.html)、[企业网站管理系统](https://www.fastadmin.net/store/ldcms.html)、[知识库文档系统](https://www.fastadmin.net/store/knowbase.html)、[在线投票系统](https://www.fastadmin.net/store/vote.html)、[B2C商城](https://www.fastadmin.net/store/shopro.html)、[B2B2C商城](https://www.fastadmin.net/store/wanlshop.html))
* 整合第三方短信接口(阿里云、腾讯云短信)
* 无缝整合第三方云存储(七牛云、阿里云OSS、腾讯云存储、又拍云)功能,支持云储存分片上传
* 第三方富文本编辑器支持(Summernote、百度编辑器)
* 第三方登录(QQ、微信、微博)整合
* 第三方支付(微信、支付宝)无缝整合微信支持PC端扫码支付
* 丰富的插件应用市场
## 安装使用
https://doc.fastadmin.net
## 在线演示
https://demo.fastadmin.net
用户名admin
 123456
提 示:演示站数据无法进行修改,请下载源码安装体验全部功能
## 界面截图
![控制台](https://images.gitee.com/uploads/images/2020/0929/202947_8db2d281_10933.gif "控制台")
## 问题反馈
在使用中有任何问题,请使用以下联系方式联系我们
问答社区: https://ask.fastadmin.net
Github: https://github.com/karsonzhang/fastadmin
Gitee: https://gitee.com/karson/fastadmin
## 特别鸣谢
感谢以下的项目,排名不分先后
ThinkPHPhttp://www.thinkphp.cn
AdminLTEhttps://adminlte.io
Bootstraphttp://getbootstrap.com
jQueryhttp://jquery.com
Bootstrap-tablehttps://github.com/wenzhixin/bootstrap-table
Nice-validator: https://validator.niceue.com
SelectPage: https://github.com/TerryZ/SelectPage
Layer: https://layuion.com/layer/
DropzoneJS: https://www.dropzonejs.com
## 版权信息
FastAdmin遵循Apache2开源协议发布并提供免费使用。
本项目包含的第三方源码和二进制文件之版权信息另行标注。
版权所有Copyright © 2017-2024 by FastAdmin (https://www.fastadmin.net)
All rights reserved。

View File

@ -108,7 +108,7 @@ return [
'title' => '上传有效时长',
'type' => 'string',
'content' => [],
'value' => 60 * 60 * 2,
'value' => '3000',
'rule' => 'required',
'msg' => '',
'tip' => '用户停留页面上传有效时长,单位秒',

View File

@ -55,7 +55,7 @@ class Order extends Backend
protected $items = null;
protected $itemsformattedTree = null;
protected $noNeedRight = ['smart','export','orderRemark'];
protected $noNeedRight = ['smart','export'];
public function _initialize()
{
@ -170,7 +170,6 @@ class Order extends Backend
'source', 'source_shop', 'source_uid', 'source', 'item_title', 'item_id', 'work_tel_id',
'detail', 'remark', 'images', 'create_time', 'update_time', 'admin_id', 'dispatch_type',
'receive_type',
'order_remark',
'plan_time',
'coupon_id',
'is_overtime',
@ -557,18 +556,6 @@ class Order extends Backend
}
public function orderRemark($ids = null)
{
$order = $this->model->where('id', $ids)->find();
$params = $this->request->post();
$remark = $params['remark'] ?? '';
$order->order_remark = $remark;
$order->save();
$this->success($order['order_no']);
}
public function warning($ids = null)
{

View File

@ -26,7 +26,6 @@ class Auditorder extends Backend
* @var \app\admin\model\Order
*/
protected $model = null;
protected $noNeedRight = ['export'];
public function _initialize()
{
@ -49,77 +48,56 @@ class Auditorder extends Backend
/**
* 查看
*/
public function index($getArray = false, $page = 0, $input_limit = 0)
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if (false === $this->request->isAjax() && $getArray == false) {
$res = $this->getSource();
$this->view->assign("sources", $res);
return $this->view->fetch();
}
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$build = $this->model
->scope('tab', Order::TAB_AUDIT)
->alias('order')
->with([
'user' => function ($q) {
$q->field('id,nickname');
}, 'workerman', 'auditadmin' => function ($q) {
$q->field('id,nickname');
}, 'source' => [
'parent' => function ($q) {
$q->field('id,title');
}
]])
->where($where)
->order($sort, $order);
$performance = 0;
if ($getArray) {
$list = $build->paginate([
'list_rows' => $input_limit,
'page' => $page
]);
} else {
$list = $build->paginate($limit);
// ✅ 新增:汇总总金额
$sum = $this->model
->where($where)
->field('SUM(performance) as performance')
->find();
$performance = $sum->performance ?? 0;
}
foreach ($list as $item) {
if (isset($item->getRelation('source')->parent->title)) {
$item->source_total_name = '【' . $item->getRelation('source')->parent->title . '】' . ($item->getRelation('source')->title ?? '');
} else {
$item->source_total_name = ($item->getRelation('source')->title ?? '');
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
unset($item->source);
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->scope('tab',Order::TAB_AUDIT)
->alias('order')
->with([
'user' => function ($q) {
$q->field('id,nickname');
},'workerman','auditadmin' => function ($q) {
$q->field('id,nickname');
}, 'source' => [
'parent' => function ($q) {
$q->field('id,title');
}
]])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $item) {
if (isset($item->getRelation('source')->parent->title)){
$item->source_total_name = '【' . $item->getRelation('source')->parent->title . '】' . ($item->getRelation('source')->title??'');
}else{
$item->source_total_name = ($item->getRelation('source')->title??'');
}
unset($item->source);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
$result = array("total" => $list->total(), "rows" => $list->items(),'sum' => $performance);
return json($result);
$res = $this->getSource();
$this->view->assign("sources", $res);
return $this->view->fetch();
}
/**
* 编辑
*
@ -130,12 +108,12 @@ class Auditorder extends Backend
*/
public function edit($ids = null)
{
$row = $this->model->get($ids, ['dispatch']);
$row = $this->model->get($ids,['dispatch']);
if (!$row) {
$this->error(__('No Results were found'));
}
if ($row->status != Order::STATUS_AUDITING) {
if($row ->status != Order::STATUS_AUDITING){
$this->error('订单状态不可审核');
}
@ -144,10 +122,10 @@ class Auditorder extends Backend
$this->error(__('You have no permission'));
}
if (false === $this->request->isPost()) {
$order = Order::where('id', $ids)->find();
$order = Order::where('id',$ids)->find();
$this->view->assign('row', $row);
$worker = Worker::withTrashed()->where('id', $order->worker_id)->find();
$this->view->assign('worker', $worker);
$this->view->assign('worker',$worker);
$this->view->assign('cdnurl', config('upload.cdnurl'));
return $this->view->fetch();
}
@ -170,9 +148,9 @@ class Auditorder extends Backend
}
$txt = '审核通过';
if ($audit_status) {
if($audit_status){
$params['status'] = Order::STATUS_FINISHED;
} else {
}else{
$params['status'] = Order::STATUS_CHECKONCE;
$txt = '审核未通过';
}
@ -185,16 +163,16 @@ class Auditorder extends Backend
$hookParams['order'] = $row;
$hookParams['role'] = 1;
$hookParams['auth'] = $this->auth;
$hookParams['remark'] = $txt . ',审核备注:' . $params['audit_remark'];
Hook::listen('order_change', $hookParams);
$hookParams['remark'] = $txt.',审核备注:'.$params['audit_remark'];
Hook::listen('order_change',$hookParams);
if ($params['status'] == Order::STATUS_CHECKONCE) {
if($params['status'] == Order::STATUS_CHECKONCE){
//未通过审核,通知派单员,重新配置
Message::create([
'to_id' => $row->dispatch_admin_id,
'type' => 1,
'title' => '订单结算审核未通过',
'content' => '【订单结算未通过】订单编号:' . $row->order_no . ',审核备注:' . $params['audit_remark'] . ',审核人:' . $this->auth->nickname
'to_id' => $row->dispatch_admin_id,
'type' => 1,
'title' => '订单结算审核未通过',
'content' => '【订单结算未通过】订单编号:'.$row->order_no.',审核备注:'.$params['audit_remark'].',审核人:'.$this->auth->nickname
]);
}
@ -210,42 +188,4 @@ class Auditorder extends Backend
$this->success();
}
public function export()
{
$columns = json_decode($this->request->get('columns', ''), true);
if (!$columns) {
$sample = $this->index(true, 1, 1)->getData();
if (!isset($sample['rows'][0])) {
return json(['code' => 0, 'msg' => '无数据可导出']);
}
$columns = [];
foreach ($sample['rows'][0] as $key => $value) {
$columns[] = ['field' => $key, 'title' => $key];
}
}
$generator = function () use ($columns) {
$limit = 1000;
$page = 1;
$order = new \app\admin\model\Order();
do {
$result = $this->index(true, $page, $limit);
$rows = $result->getData()['rows'] ?? [];
if (!$rows) break;
foreach ($rows as $item) {
$item->status = $order->getStatusList()[$item->status] ?? '';
$item->amount_images = $this->dealImages($item->amount_images);
$item->workerman->images = $this->dealImages($item->workerman->images);
yield $item->toArray();
}
$page++;
} while (count($rows) === $limit);
};
$this->streamCsv($columns, $generator(), '订单导出_' . date('Ymd_His') . '.csv');
}
}

View File

@ -282,7 +282,7 @@ class Dispatch2 extends Backend
$params = $this->request->post('row/a');
dd($params);
$orderParsms = $this->request->post('order/a');
if (empty($params) || empty($orderParsms)) {
$this->error(__('Parameter %s can not be empty', ''));

View File

@ -29,9 +29,6 @@ class Review extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\OrderReview;
$order = new Order();
$this->view->assign("statusList", $order->getStatusList());
$this->view->assign("offlineTotalTypeList", $order->getOfflineTotalTypeList());
}

View File

@ -96,7 +96,7 @@ class Item extends Backend
if (!empty($filter)){
$arr = explode(' - ', $filter);
if (trim($arr[0])) {
$start = trim($arr[0]). ' 00:00:00';
$start = trim($arr[0]);
}
if (trim($arr[1])) {
$end_at = trim($arr[1]) . ' 23:29:59';
@ -113,6 +113,10 @@ class Item extends Backend
if(!empty(request()->get('source',null))){
$build->where('source',request()->get('source'));
}
//城市
/* if(!empty(request()->post('area_id',null))){
$build->where('area_id','LIKE',request()->post('source').'%');
}*/
if(!empty(request()->get('item_id',null))){
$item_id =request()->get('item_id');
@ -121,7 +125,7 @@ class Item extends Backend
$build->whereIn('item_id', $item_ids);
}
$build->whereBetween('audit_time', [$start, $end_at])
$build->whereBetween('create_time', [$start, $end_at])
->field([
'item_title name', // 类型
'sum(total) total', // 营业额
@ -137,7 +141,6 @@ class Item extends Backend
])->group('item_title')
->order('count_num', 'desc');
// dd($total);
$res = $build->paginate($limit);
$total = $res->total();
$ress = $res->items();

View File

@ -85,11 +85,10 @@ class Worker extends Backend
$this->request->filter(['strip_tags', 'trim']);
$items = $this->items;
$filtered = array_filter($items, function ($item) {
return $item['level'] == 2;
return $item['pid'] == 0;
});
$pid_map = array_column($filtered, null, 'id');
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
@ -136,8 +135,7 @@ class Worker extends Backend
$worker_ids = [];
foreach ($list->items() as $item){
$dt = $item->toArray();
preg_match_all('/\d+/', $dt['tel'], $matches);;
$tel = $matches[0][0] ?? '';
$tel = $dt['tel'];
if (preg_match('/^\d{7,}$/', $tel)) {
$dt['tel'] = mb_substr($tel, 0, 3, 'UTF-8') . '****' . mb_substr($tel, -4, null, 'UTF-8');
} else {
@ -147,9 +145,8 @@ class Worker extends Backend
$data[] = $dt;
$worker_ids [] = $item['id'];
}
$worker_item = WorkerItem::whereIn('worker_id',$worker_ids)->where('item_path_id',2)
$worker_item = WorkerItem::whereIn('worker_id',$worker_ids)->where('item_path_id',1)
->field('worker_id,item_id')->select();
$worker_item_map = [];
// dd($worker_item);
foreach ($worker_item as $item){
@ -159,14 +156,12 @@ class Worker extends Backend
// dd($worker_item_map);
if (key_exists($datum['id'],$worker_item_map)){
foreach ($worker_item_map[$datum['id']] as $item){
if ($pid_map[$item] ?? false){
$datum ['worker_item'][] = str_replace(" ",'',$pid_map[$item]['title']);
}
$datum ['worker_item'][] = trim($pid_map[$item]['title']);
}
}else{
$datum ['worker_item'] = [];
}
$datum['worker_item'] = implode(',',$datum['worker_item'] ?? []);
$datum['worker_item'] = implode(',',$datum['worker_item']);
}

View File

@ -7,10 +7,5 @@ return [
'Worker_star' => '师傅评分',
'Remark' => '备注',
'Admin_id' => '回访人',
'Admin_user' => '回访人',
'Coupons' => '优惠',
'Offline_amount_type' => '线下尾款类型',
'Offline_amount_type 0' => '无',
'Offline_amount_type 1' => '师傅收',
'Offline_amount_type 2' => '公司收',
'Admin_user' => '回访人'
];

View File

@ -98,6 +98,7 @@ class Item extends Model
foreach ($data as $item) {
$index[$item['pid']][] = $item;
}
// 递归函数,闭包形式避免污染全局
$collect = function($pid) use (&$collect, &$index) {
$ids = [];

View File

@ -8,7 +8,6 @@
<link rel="shortcut icon" href="__CDN__/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="__CDN__/assets/css/backend{$Think.config.app_debug?'':'.min'}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
<link href="__CDN__/assets/css/common.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">
{if $Think.config.fastadmin.adminskin}
<link href="__CDN__/assets/css/skins/{$Think.config.fastadmin.adminskin|htmlentities}.css?v={$Think.config.site.version|htmlentities}" rel="stylesheet">

View File

@ -20,9 +20,6 @@
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<a href="javascript:;" class="btn btn-success btn-export" id="btn-export">
<i class="fa fa-download"></i> 导出
</a>
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('orders/auditorder/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('orders/auditorder/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('orders/auditorder/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>

View File

@ -1,5 +1,12 @@
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Order_id')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-order_id" data-rule="required" data-field="order_no" data-source="order/index" class="form-control selectpage" name="row[order_id]" type="text" value="{$row.order_id|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('订单编号')}:</label>
@ -8,6 +15,42 @@
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('客户姓名')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-customer" readonly class="form-control" type="text" value="{$order.customer|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('客户电话')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-tel" readonly class="form-control" type="text" value="{$order.tel|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('客户地址')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-address" readonly class="form-control" type="text" value="{$order.area.short_merge_name|htmlentities} {$order.address|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('服务类目')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-item_title" readonly class="form-control" type="text" value="{$order.item_title|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Order.detail')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-detail" readonly class="form-control" type="text" value="{$order.detail|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
{notempty name ='action'}
<input id="c-action" name="row[action]" type="hidden" value="{$action|htmlentities}">
@ -35,26 +78,38 @@
<!-- <input readonly type="text" class="form-control" value="{$row.status_text|htmlentities}">-->
<!-- </div>-->
<!-- </div>-->
{if $row['is_receipt']==0 }
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('线上收款')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="order-online-amount" name="order[online_amount]" readonly type="text" class="form-control" value="{$order.online_amount|htmlentities}">
<input id="order-online-amount" name="order[online_amount]" type="text" class="form-control" value="{$order.online_amount|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">收款方式:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('尾款收款')}:</label>
<div class="col-xs-12 col-sm-8">
<select name="order[is_receipt]" id="receive_type" class="form-control selectpicker">
<option {if 1 == $order.receive_type} selected {/if} value="1">没有尾款</option>
<option {if 0 == $order.receive_type} selected {/if} value="0">收尾款</option>
</select>
<input readonly class="form-control" type="text" value="无需收尾款">
</div>
</div>
{/if}
{if $row['is_receipt']==1 }
<div id="other_info">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('线上预付')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="order-online-amount" name="order[online_amount]" type="text" class="form-control" value="{$order.online_amount|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('线上尾款')}:</label>
@ -62,20 +117,25 @@
<input id="c-online_total" name="row[online_total]" data-rule="required" type="number" min="0" placeholder="请输入线上尾款金额" class="form-control" value="{$row.online_total|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Offline_total_type')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Offline_total_type')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[offline_total_type]',$offlineTotalTypeList,$row['offline_total_type'],['class'=>'form-control selectpicker','data-rule'=>'required'])}
</div>
{:build_select('row[offline_total_type]',$offlineTotalTypeList,$row['offline_total_type'],['class'=>'form-control','data-rule'=>'required'])}
</div>
<div class="form-group">
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('线下尾款')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-total" data-rule="required" placeholder="请输入线下尾款金额" class="form-control" name="row[total]" type="number" min="0" value="{$row.total|htmlentities}">
</div>
</div>
<div class="form-group">
<label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('收款凭据')}:</label>
<div class="col-xs-12 col-sm-8">
@ -90,7 +150,9 @@
<ul class="row list-inline faupload-preview" id="p-image"></ul>
</div>
</div>
</div>
{/if}
<!--<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('材料成本(¥)')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@ -53,7 +53,7 @@
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('线上尾款类型')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_select('row[offline_amount_type]',$offlineTotalTypeList,$row['offline_amount_type'],['class'=>'form-control','readonly','data-rule'=>'required'])}
{:build_select('row[offline_amount_type]',$offlineTotalTypeList,$row['offline_amount_type'],['class'=>'form-control readonly','data-rule'=>'required'])}
</div>
</div>

View File

@ -784,6 +784,7 @@ class Backend extends Controller
$fields = array_column($columns, 'field');
$titles = array_column($columns, 'title');
// 写入表头
fputcsv($output, $titles);
@ -817,18 +818,4 @@ class Backend extends Controller
}
return $data;
}
protected function dealImages($image_str)
{
if (empty($image_str)){
return '';
}
$images = explode(',', $image_str);
$url = '';
foreach ($images as $img) {
if (empty($img)) continue;
$url .= cdnurl($img) . ',';
}
return $url;
}
}

1129
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
/* 固定分页条 */
.fixed-table-body{
max-height: calc(100vh - 240px) !important;
}

View File

@ -90,7 +90,7 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
pk: 'id',
sortName: 'id',
fixedRightNumber: 1,
fixedNumber: 5,
fixedNumber: 4,
fixedColumns: true,
renderDefault: true,
searchFormVisible: true,
@ -125,12 +125,6 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
"10": "my_dispatch"
}
},
{
field: 'order_remark',
title: '标记',
operate: 'like',
autocomplete: false
},
{
field: 'create_time',
title: __('Create_time'),
@ -387,45 +381,6 @@ ${data.receive_type == 1 ? '已收定金' : '已收全款'}
return false;
},
},
{
name: "order_remark",
text: "标记",
title: "标记",
classname: 'btn btn-xs btn-click',
icon: 'fa fa-comment',
click: function (e, row) {
Layer.open({
type: 1,
title: '请输入备注信息(可为空)',
area: ['400px', '250px'],
btn: ['确定', '取消'],
content: '<div style="padding:20px;">' +
'<textarea id="remark-input" style="width:100%;" rows="4" placeholder="留空表示清空备注">' +
(row.order_remark || '') + '</textarea>' +
'</div>',
yes: function (index, layero) {
var text = $('#remark-input').val();
Fast.api.ajax({
type: 'POST',
url: 'order/orderRemark/ids/' + row.id,
data: {id: row.id, remark: text},
}, function (data, ret) {
Layer.close(index);
Toastr.success("备注提交成功");
table.bootstrapTable('refresh');
return false;
});
}
});
},
dropdown: "更多",
visible: function (row) {
if (Config.permissions.reminder && row.status == 10) {
return true;
}
return false;
},
},
{
name: "copy_text",
text: "复制信息",

View File

@ -34,30 +34,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
params.op = JSON.stringify(op);
return params;
},
onLoadSuccess: function (data) {
var sum = data || {};
// 1) 把汇总放到表格上方(可改为 append 到其它元素)
$('#table-sum-area').remove(); // 先移除已有的,防止重复
var html = '<div id="table-sum-area" style="margin:8px 0;text-align:right;">' +
'筛选条件总计 — 总预计利润:<strong>' + (parseFloat(data.sum || 0).toFixed(2)) + '</strong>' +
',总数量:<strong>' + (parseInt(data.total || 0)) + '</strong>' +
'</div>';
// 把汇总放在表格容器前面(你也可以放到 table.closest('.bootstrap-table') 里)
table.closest('.bootstrap-table').before(html);
// 2) (可选)如果你想把汇总放到表格 footer 的某一列,用 footerFormatter 示例:
// 注意footerFormatter 会在表格渲染 footer 时调用,这里只是演示
// 例如你有一列 field: 'real_amount',它的 footerFormatter 可以是:
// footerFormatter: function () { var s = table.data('sum') || {}; return (parseFloat(s.real_amount||0)).toFixed(2); }
},
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'update_time',
sortOrder: 'desc',
fixedColumns: true,
fixedRightNumber: 1,
showExport: false,
columns: [
[
// {checkbox: true},
@ -148,33 +131,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
]
]
});
table.closest('.bootstrap-table').addClass('table-with-fixed-pagination');
$('#btn-export').on('click', function () {
var options = $("#table").bootstrapTable('getOptions');
// 提取列信息(不含 checkbox
var columns = [];
$.each(options.columns[0], function (i, item) {
if (item.field && !item.checkbox && !item.visible === false) {
columns.push({
field: item.field,
title: item.title
});
}
});
var params = {
columns: JSON.stringify(columns),
filter: options.queryParams({}).filter || {},
op: options.queryParams({}).op || {},
sort: options.sortName,
order: options.sortOrder
};
// console.log($.param(params))
var url = '/admin/orders/auditorder/export?' + $.param(params);
window.open(url); // 发起文件下载
});
// 为表格绑定事件
Table.api.bindevent(table);
},

View File

@ -436,6 +436,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
// 判断 #c-action 是否存在且有值
const $action = $("#c-action");
if ($action.length && $action.val()) {
function calculatePerformance() {
//console.log("sb:计算利润...");
const orderOnlineAmount = parseFloat($("#order-online-amount").val()) || 0;
//console.log("sb:计算利润:预收款..."+orderOnlineAmount);
const onlineAmountLast = parseFloat($("#c-online_total").val()) || 0; //线上尾款
//console.log("sb:计算利润:线上尾款..."+onlineAmountLast);
const offlineAmount = parseFloat($("#c-total").val()) || 0; //线下尾款
//console.log("sb:计算利润:线下尾款..."+offlineAmount);
const cost = parseFloat($("#order-cost").val()) || 0; //成本
//console.log("sb:计算利润:师傅成本..."+cost);
const materialCost = parseFloat($("#order-material_cost").val()) || 0;//材料
//console.log("sb:计算利润:材料成本..."+materialCost);
const performance = (orderOnlineAmount + onlineAmountLast + offlineAmount) - (cost + materialCost);
$("#c-performance").val(performance.toFixed(2));
}
/* ["c-online_total", "c-total", "order-cost", "order-material_cost"].forEach(function(id) {
$("#" + id).on("input", calculatePerformance);
@ -449,34 +465,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
// 页面加载时先算一次
calculatePerformance();
}
function calculatePerformance() {
//console.log("sb:计算利润...");
const orderOnlineAmount = parseFloat($("#order-online-amount").val()) || 0;
//console.log("sb:计算利润:预收款..."+orderOnlineAmount);
const onlineAmountLast = parseFloat($("#c-online_total").val()) || 0; //线上尾款
//console.log("sb:计算利润:线上尾款..."+onlineAmountLast);
const offlineAmount = parseFloat($("#c-total").val()) || 0; //线下尾款
//console.log("sb:计算利润:线下尾款..."+offlineAmount);
const cost = parseFloat($("#order-cost").val()) || 0; //成本
//console.log("sb:计算利润:师傅成本..."+cost);
const materialCost = parseFloat($("#order-material_cost").val()) || 0;//材料
//console.log("sb:计算利润:材料成本..."+materialCost);
const performance = (orderOnlineAmount + onlineAmountLast + offlineAmount) - (cost + materialCost);
$("#c-performance").val(performance.toFixed(2));
}
function toggleReceiveFields() {
const type = $('#receive_type').val();
if (type === '0') {
$('#other_info').show();
} else {
$('#other_info').hide();
}
}
toggleReceiveFields();
$('#receive_type').on('change', function () {
toggleReceiveFields();
});
},
addrecord: function () {
Controller.api.bindevent();

View File

@ -59,12 +59,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree','cascader'],
},
{
field: 'worker_item',
width:500,
title: '工种',
operate: false,
table: table,
class: 'autocontent',
formatter: Table.api.formatter.content
},
//{field: 'area_id', title: __('Area_id')},
//{field: 'lng', title: __('Lng'), operate:'BETWEEN'},

View File

@ -1,34 +0,0 @@
#!/bin/bash
# 配置参数
HOST="rm-bp1769w7k3om452lvzo.mysql.rds.aliyuncs.com"
USER="wanyu"
SOURCE_DB="wanyu"
TARGET_DB="wanyu_test"
# 输入密码(不回显)
read -s -p "请输入数据库用户 $USER 的密码: " DBPASS
echo ""
# 检查目标库是否存在,不存在就创建
echo "🧩 检查目标数据库 $TARGET_DB 是否存在..."
mysql -h $HOST -u $USER -p"$DBPASS" -e "CREATE DATABASE IF NOT EXISTS \`$TARGET_DB\` CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" || {
echo "❌ 无法连接或创建目标数据库 $TARGET_DB"
exit 1
}
# 开始导出并导入
echo "📦 正在从 $SOURCE_DB 导出并导入到 $TARGET_DB,请稍候..."
mysqldump -h $HOST -u $USER -p"$DBPASS" \
--single-transaction \
--set-gtid-purged=OFF \
--routines --triggers --events \
"$SOURCE_DB" | mysql -h $HOST -u $USER -p"$DBPASS" "$TARGET_DB"
# 检查导入结果
if [ $? -eq 0 ]; then
echo "✅ 数据库复制完成:$SOURCE_DB$TARGET_DB"
else
echo "❌ 数据库复制失败,请检查日志或权限设置"
fi

View File