Commit 23ec91cf authored by zw's avatar zw

Merge branch 'test'

parents 33ec00c4 7456411d
......@@ -31,7 +31,7 @@ class CellPhone extends Basic
header('Access-Control-Allow-Origin:*');
$call = new CallPhoneService($this->city);
$call = new CallPhoneService($this->city, $this->siteId);
$record = true; //是否录音
$user_id = empty($this->params['user_id']) ? 0:(int)$this->params['user_id'];
$house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id'];
......
......@@ -39,8 +39,9 @@ class CallPhoneService
private $city;
public $redis;
private $m_bind;
private $site_id;
public function __construct(string $city = '上海市')
public function __construct(string $city = '上海市', int $site_id = 10001)
{
$this->city = substr($city, 0, strpos($city, '市')); //去市
$this->redis = RedisExt::getRedis();
......@@ -52,6 +53,7 @@ class CallPhoneService
$this->day_num = empty($this->day_num) ? 1 : $this->day_num + 1;
$this->landlord_phone_day = empty($this->landlord_phone_day) ? 1 : $this->landlord_phone_day + 1;
$this->m_bind = new BindingPhone();
$this->site_id = $site_id;
}
/**
......@@ -547,13 +549,12 @@ class CallPhoneService
$follow_where['agent_id'] = $array[0];
$follow_where['user_id'] = $array[1];
if(isset($array[2])){
$follow_where['site_id'] = $array[2];
$site_id = $array[2];
}else{
$follow_where['site_id'] = "10001";
$site_id = '10001';
}
$m_follow_up = new UPhoneFollowPp($follow_where['site_id']);
$m_follow_up = new UPhoneFollowPp($site_id);
$num = $m_follow_up->getFollowTotal($follow_where);
if (empty($num) && !empty($array[1])) {
//$agent_id, $user_id, $content, $type
$m_follow_up->insertDefaultFollow($array[0], $array[1], $content, 0);
......@@ -585,7 +586,7 @@ class CallPhoneService
}
if ($user_type == 1) {
$this->redis->hSet($key, $agent_id . '-' . $user_id, time());
$this->redis->hSet($key, $agent_id . '-' . $user_id. '-'. $this->site_id, time());
} else {
$this->redis->hSet($key, $agent_id . '-' . $user_id . '-' . $phone_a . '-' . $phone_b, time());
}
......
......@@ -284,7 +284,7 @@
<a href="javascript:;" id="fix_area_bottom_btn"><img src="/app/images/xq_cha@2x.png" /></a>
</div>
<div class="shop-list">
<img src="/app/images/img_more@2x.png" alt="" />
<!--<img src="/app/images/img_more@2x.png" alt="" />-->
</div>
<!--<script src="/app/js/jquery.js"></script>-->
......
......@@ -275,7 +275,7 @@ class CellPhone extends Basic
$house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id'];
$landlord = empty($this->params['landlord']) ? 0: (int)$this->params['landlord'];
$record = true; //录音
$call_phone = new CallPhoneService($this->city);
$call_phone = new CallPhoneService($this->city, $this->siteId);
$data = $call_phone->bindAXB($this->params['phone_a'], $phone_b, $record, $user_id, $this->userId, $this->userName, $landlord, $house_id);
$result['msg'] = '';
if ($data['status'] == 'success') {
......
......@@ -913,18 +913,64 @@ class Finance extends Basic
$where['e.id'] = $this->params['partial_id'];
}
$field = 'a.id,a.confirm_date,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,cash,service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission';
$field = 'a.id,a.confirm_date,a.practical_fee,b.scale_fee,b.scale,b.role,d.internal_address,b.agent_id,cash,service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission';
$m_commission = new OPartialCommission();
try {
$data = $m_commission->getCommissionBargainColumn($pageNo, $pageSize, 'a.id desc', $field, $where);
$m_agent = new AAgents();
$m_real = new ORealIncome();
$fields_str = 'a.id,a.name,a.phone,b.store_name,c.district_name';
$result = [];
foreach ($data as $k => $v) {
$result[$k]['income_time'] = $m_real->where('id', $v['real_income_id'])->value('income_time');
if ($v['agent_id']) {
$agent_data = $m_agent->getStoreDistrict($fields_str, [ 'a.id' => $v['agent_id'] ]);
$result[$k]['district_store'] = $agent_data['store_name'] . '-' . $agent_data['store_name'];
$result[$k]['agent'] = $agent_data['name'] . '-' . $agent_data['phone'];
}
switch ($v['role']) {
case 1:
$result[$k]['role'] = '盘方';
break;
case 2:
$result[$k]['role'] = '客方';
break;
case 3:
$result[$k]['role'] = '反签';
break;
case 4:
$result[$k]['role'] = '独家';
break;
case 5:
$result[$k]['role'] = '合作方';
break;
case 6:
$result[$k]['role'] = 'APP盘下载方';
break;
case 7:
$result[$k]['role'] = 'APP客下载方';
break;
default:
$result[$k]['role'] = '未定义';
}
$result[$k]['scale'] = $v['scale'];
$result[$k]['should_commission'] = $v['should_commission'];
$result[$k]['real_fee'] = $v['real_fee'];
$result[$k]['service_charge'] = $v['service_charge'];
$result[$k]['charity_fund'] = $v['charity_fund'];
$result[$k]['cash'] = $v['cash'];
$result[$k]['practical_fee'] = $v['practical_fee'];
}
} catch (\Exception $e) {
return '<script>alert("导出分佣提成明细列表失败");window.close();</script>';
}
$export = new ExportExcelUntil();
$title = [ '收佣日期', '所属部门/门店', '业务员', '应分佣金(元)', '预分佣金(元)', '手续费(元)', '慈善基金(元)', '现金奖(元)', '实收佣金(元)' ];
$export->exportTable('实收明细表', $data, 8, '实收明细表', $title);
$title = [ '收佣日期', '所属部门/门店', '业务员','分佣角色', '分佣比例(%)','应分佣金(元)', '预分佣金(元)', '手续费(元)', '慈善基金(元)', '现金奖(元)', '实收佣金(元)' ];
$export->exportTable('实收明细表', $result, 10, '实收明细表', $title);
return '';
}
......
......@@ -34,7 +34,7 @@
<tr>
<th class="text-center">姓名</th>
<th class="text-center">手机号</th>
<th class="text-center">通话时长</th>
<th class="text-center">通话时长(分钟)</th>
<th class="text-center">花费</th>
</tr>
</thead>
......
......@@ -257,7 +257,7 @@
<a href="javascript:;" id="fix_area_bottom_btn"><img src="/app/images/xq_cha@2x.png" /></a>
</div>
<div class="shop-list">
<img src="/app/images/img_more@2x.png" alt="" />
<!--<img src="/app/images/img_more@2x.png" alt="" />-->
</div>
<!--<script src="/app/js/jquery.js"></script>-->
......
......@@ -88,6 +88,14 @@ class OPartialCommission extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
/**
* @param $pageNo
* @param $pageSize
* @param string $order_
* @param $fields
* @param $where
* @return array
*/
public function getCommissionBargainColumn($pageNo, $pageSize, $order_ = 'id desc', $fields, $where)
{
$data = $this->alias('a')
......@@ -101,27 +109,7 @@ class OPartialCommission extends BaseModel
->limit($pageSize)
->page($pageNo)
->column($fields);
$result = [];
$m_agent = new AAgents();
$m_real = new ORealIncome();
$fields_str = 'a.id,a.name,a.phone,b.store_name,c.district_name';
foreach ($data as $k => $v) {
$result[$k]['income_time'] = $m_real->where('id', $v['real_income_id'])->value('income_time');
if ($v['agent_id']) {
$agent_data = $m_agent->getStoreDistrict($fields_str, [ 'a.id' => $v['agent_id'] ]);
$result[$k]['district_store'] = $agent_data['store_name'] . '-' . $agent_data['store_name'];
$result[$k]['agent'] = $agent_data['name'] . '-' . $agent_data['phone'];
}
$result[$k]['should_commission'] = $v['should_commission'];
$result[$k]['real_fee'] = $v['real_fee'];
$result[$k]['service_charge'] = $v['service_charge'];
$result[$k]['charity_fund'] = $v['charity_fund'];
$result[$k]['cash'] = $v['cash'];
$result[$k]['practical_fee'] = $v['practical_fee'];
}
return $result;
return $data;
}
/**
......
......@@ -439,17 +439,39 @@ body{
text-overflow: ellipsis;
margin-top: 0.16rem;
}
/*商铺详情 动画*/
.shop-list{
position: fixed;
right: .2rem;
bottom: 2rem;
height: 1.6rem;
width: 1.6rem;
height: 2rem;
width: 2.15rem;
display: none;
background: url(/app/images/Artboard@1x.png) no-repeat 0 0;
background-size: 43rem 2rem;
animation: fly 1.25s steps(20) infinite;
-webkit-animation: fly 1.25s steps(20) infinite;
}
@keyframes fly {
0% {
background-position: 0 0;
}
100% {
background-position: -43rem 0;
}
}
.shop-list img{
@-webkit-keyframes fly {
0% {
background-position: 0 0;
}
100% {
background-position: -43rem 0;
}
}
/*.shop-list img{
width: 1.6rem;
}
}*/
.b3_span_shop_mianji{
display: none;
}
......@@ -487,3 +509,4 @@ body{
margin-bottom: .3rem;
}
......@@ -4,7 +4,7 @@
<tr class="text-center">
<td>[%= it[item]['name'] %]</td>
<td>[%= it[item]['phone'] %]</td>
<td>[%= it[item]['time'] %]</td>
<td>[%= Math.round(it[item]['time']/60) %]</td>
<td>[%= it[item]['money'] %] </td>
</tr>
[% } %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment