edit-admin-get_commission

This commit is contained in:
lccsw
2021-12-22 16:33:40 +08:00
parent b3c18cbd59
commit 867eabc784
2 changed files with 32 additions and 5 deletions
@@ -18,6 +18,10 @@ class Distribution extends AppBase
$this->load->model('app/User_account_model', 'mdUserAccount');
$this->load->model('app/User_accountlog_model', 'mdUserAccountLog');
$this->load->model('app/Deal_log_model', 'mdDealLog');
$this->load->model('receiver/order/receiver_orders_model', 'mdOrders');
$this->load->model('auto/auto_series_model');
$this->load->model('auto/auto_brand_model');
$this->load->model('auto/auto_attr_model');
if ($this->app_id) {
$this->load->model($this->mdApp->appConfig()[$this->app_id]['model'], 'mdAppUser');
if ($this->app_info()['lock_fans'] == 1) {
@@ -254,9 +258,28 @@ class Distribution extends AppBase
$count = $this->mdDealLog->count($where);
if ($count) {
$res = $this->mdDealLog->select($where, 'id DESC', $params['page'], $params['size'], 'cf_sid,type,status,money,c_time');
$o_ids = array_column($res,'cf_sid') ? implode("','",array_column($res,'cf_sid')) : '';
if($o_ids){
$o_where = [
"sid in ('{$o_ids}')" => null
];
$order_rows = $this->mdOrders->map('sid','',$o_where,'','','','id,sid,name,mobile,brand_id,s_id,v_id,cor_id,incor_id,c_time');
}
foreach ($res as $key => $value) {
$setValue = array();
$order = $order_rows[$value['cf_sid']] ? $order_rows[$value['cf_sid']][0] : [];
$expect_money = 0.00;
$setValue['name'] = $order['name'];
$setValue['mobile'] = $order['mobile'];
$setValue['order_time'] = $order['c_time'] ? date('Y.m.d H:i',$order['c_time']) : '';
$car = '';
if($order){
$brand = $this->auto_brand_model->get(['id'=>$order['brand_id']],'name');
$series = $this->auto_series_model->get(['id'=>$order['s_id']],'name');
$version = $this->auto_attr_model->get(["id"=>$order['v_id']]);
$car = "{$brand['name']}·{$series['name']}·{$version['title']}";
}
$setValue['car'] = $car;
$setValue['cf_sid'] = $value['cf_sid'];
$setValue['status'] = $value['status'];
$setValue['status_name'] = $statusAry[$value['status']];
@@ -6,7 +6,7 @@
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="order-lists-time" type="text" name="time" value="<?= $params['time'] ?>"
<input id="order-lists-time" type="text" name="time" value="<?= $params['time'] ?>" autocomplete="off"
placeholder="创建日期范围"/>
</div>
</div>
@@ -30,20 +30,24 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>购车订单号</span></th>
<th width="10%"><span>客户姓名</span></th>
<th width="10%"><span>手机号</span></th>
<th width="10%"><span>车型</span></th>
<th width="10%"><span>订单日期</span></th>
<th width="10%"><span>佣金</span></th>
<th width="10%"><span>状态</span></th>
<th width="10%"><span>创建时间</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['cf_sid'] ?></td>
<td><?= $v['name'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['car'] ?></td>
<td><?= $v['order_time'] ?></td>
<td><?= $v['expect_money'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
<?php }
} ?>