配置订单
This commit is contained in:
parent
d3d63f4872
commit
09e94cd7b3
|
|
@ -56,9 +56,10 @@ class Configorder extends Backend
|
|||
return $this->selectpage();
|
||||
}
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
|
||||
$list = $this->model
|
||||
->scope('tab',Order::TAB_SETTING)
|
||||
->tab(Order::TAB_SETTING)
|
||||
->auth($this->auth)
|
||||
->areaauth($this->auth)
|
||||
->with(['dispatch'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
|
|
@ -127,8 +128,8 @@ class Configorder extends Backend
|
|||
];
|
||||
|
||||
$data['total'] = bcadd($row->online_amount,$params['offline_amount'],2);
|
||||
$data['real_amount'] = bcdiv($data['total'],$params['refund_amount'],2);
|
||||
$data['performance'] = bcdiv($data['real_amount'],$params['cost'],2);
|
||||
$data['real_amount'] = bcsub($data['total'],$params['refund_amount'],2);
|
||||
$data['performance'] = bcsub($data['real_amount'],$params['cost'],2);
|
||||
$result = $row->allowField(true)->save($data);
|
||||
|
||||
//日志
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ class Dispatch2 extends Backend
|
|||
|
||||
$list = $this->model
|
||||
->with(['order'])
|
||||
->auth($this->auth)
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ return [
|
|||
'From 1' => '师傅',
|
||||
'From 2' => '顾客',
|
||||
'From 3' => '平台',
|
||||
'Refund_amount' => '总退款金额',
|
||||
'Refund_amount' => '退款金额',
|
||||
'Company_refund_amount' => '公司退款金额',
|
||||
'Worker_refund_amount' => '师傅退款金额',
|
||||
'Refund_type' => '退款方式',
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ return [
|
|||
'Online_amount' => '线上收款',
|
||||
'Offline_amount' => '线下收款',
|
||||
'Discount_amount' => '优惠抵扣',
|
||||
'Refund_amount' => '总退款额',
|
||||
'Refund_amount' => '退款金额',
|
||||
'Real_amount' => '实际收款',
|
||||
'Cost' => '师傅成本',
|
||||
'Performance' => '预计利润',
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ return [
|
|||
'Order.online_amount' => '线上收款',
|
||||
'Order.offline_amount' => '线下收款',
|
||||
'Order.discount_amount' => '优惠抵扣',
|
||||
'Order.refund_amount' => '总退款额',
|
||||
'Order.refund_amount' => '退款金额',
|
||||
'Order.real_amount' => '实际收款',
|
||||
'Order.cost' => '师傅成本',
|
||||
'Order.performance' => '预计利润',
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ return [
|
|||
'Order.online_amount' => '线上收款',
|
||||
'Order.offline_amount' => '线下收款',
|
||||
'Order.discount_amount' => '优惠抵扣',
|
||||
'Order.refund_amount' => '总退款额',
|
||||
'Order.refund_amount' => '退款金额',
|
||||
'Order.real_amount' => '实际收款',
|
||||
'Order.cost' => '师傅成本',
|
||||
'Order.performance' => '预计利润',
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\admin\library\Auth;
|
||||
use think\Model;
|
||||
use traits\model\SoftDelete;
|
||||
|
||||
|
|
@ -158,4 +159,38 @@ class Order extends Model
|
|||
{
|
||||
return $this->hasOne(OrderDispatch::class, 'order_id', 'id', [], 'LEFT')->setEagerlyType(0)->where('fa_order_dispatch.status',OrderDispatch::STATUS_FINISH);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 管理员权限
|
||||
* @param $query
|
||||
* @param Auth $auth
|
||||
* @param string $auth_admin_id
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeAuth($query, Auth $auth, string $admin_id_field='admin_id'){
|
||||
|
||||
if(!$auth->isSuperAdmin()){
|
||||
$query->where('fa_order.'.$admin_id_field,$auth->id);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* 地域权限
|
||||
* @param $query
|
||||
* @param Auth $auth
|
||||
* @param string $area_id_field
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeAreaauth($query,Auth $auth,string $area_id_field='area_id'){
|
||||
if(!$auth->isSuperAdmin()){
|
||||
$areaIds = array_unique(array_filter(explode(',',trim($auth->area_ids))));
|
||||
if(!in_array('*',$areaIds)){
|
||||
$query->whereIn('fa_order.'.$area_id_field,$areaIds);
|
||||
}
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\admin\model;
|
||||
|
||||
use app\admin\library\Auth;
|
||||
use think\Model;
|
||||
|
||||
|
||||
|
|
@ -151,4 +152,22 @@ class OrderDispatch extends Model
|
|||
|
||||
return $btns[$btn]??[];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 管理员权限
|
||||
* @param $query
|
||||
* @param Auth $auth
|
||||
* @param string $auth_admin_id
|
||||
* @return mixed
|
||||
*/
|
||||
public function scopeAuth($query, Auth $auth, string $admin_id_field='admin_id'){
|
||||
|
||||
if(!$auth->isSuperAdmin()){
|
||||
$query->where('fa_order_dispatch.'.$admin_id_field,$auth->id);
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,13 +58,13 @@
|
|||
<input id="c-cost" data-rule="required" class="form-control" step="0.01" name="row[cost]" type="number" value="{$row.cost|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<!-- <div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Performance')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-performance" readonly class="form-control" step="0.01" type="number" value="{$row.performance|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
-->
|
||||
|
||||
{notempty name='row.audit_admin_id'}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,8 +150,7 @@
|
|||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('立即完成任务')}</button>
|
||||
<span class="warning text-danger " style="font-size: 13px;margin-left:5px;" > 请确认无误后操作</span>
|
||||
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('立即完成任务')}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ return [
|
|||
// 日志保存目录
|
||||
'path' => LOG_PATH,
|
||||
// 日志记录级别
|
||||
'level' => [],
|
||||
'level' => ['log','error'],
|
||||
],
|
||||
// +----------------------------------------------------------------------
|
||||
// | Trace设置 开启 app_trace 后 有效
|
||||
|
|
|
|||
|
|
@ -49,6 +49,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'online_amount', title: __('Online_amount'), operate:'BETWEEN'},
|
||||
{field: 'offline_amount', title: __('Offline_amount'), operate:'BETWEEN'},
|
||||
|
||||
{field: 'refund_amount', title: __('Refund_amount'), operate:'BETWEEN'},
|
||||
{field: 'real_amount', title: __('Real_amount'), operate:'BETWEEN'},
|
||||
{field: 'cost', title: __('Cost'), operate:'BETWEEN'},
|
||||
{field: 'performance', title: __('Performance'), operate:'BETWEEN'},
|
||||
|
||||
// {field: 'dispatch_type', title: __('Dispatch_type')},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user