提交 6248feaa authored 作者: 窦斌's avatar 窦斌

edit

上级 48106524
...@@ -261,29 +261,31 @@ trait ExcelTemp ...@@ -261,29 +261,31 @@ trait ExcelTemp
['field_name' => '服务商', 'field_value' => 'company_name'],//39 ['field_name' => '服务商', 'field_value' => 'company_name'],//39
['field_name' => '第三方价格', 'field_value' => 'p_price'],//40 ['field_name' => '服务技师', 'field_value' => 'intall_person'],//40
['field_name' => '第三方结算单号', 'field_value' => 'wat_three'],//41 ['field_name' => '第三方价格', 'field_value' => 'p_price'],//41
['field_name' => '第三方申请结算时间', 'field_value' => 'three_apply_for_time'],//42 ['field_name' => '第三方结算单号', 'field_value' => 'wat_three'],//42
['field_name' => ' 第三方付款时间', 'field_value' => 'three_apply_pay_time'],//43 ['field_name' => '第三方申请结算时间', 'field_value' => 'three_apply_for_time'],//43
['field_name' => ' 用友编号', 'field_value' => 'ser_yycode'],//44 ['field_name' => ' 第三方付款时间', 'field_value' => 'three_apply_pay_time'],//44
['field_name' => '扣除补货货款', 'field_value' => '249_titleid'],//45 ['field_name' => ' 用友编号', 'field_value' => 'ser_yycode'],//45
['field_name' => '姓名', 'field_value' => 'shr_name'],//46 ['field_name' => '扣除补货货款', 'field_value' => '249_titleid'],//46
['field_name' => ' 省份', 'field_value' => 'shr_sheng'],//47 ['field_name' => '姓名', 'field_value' => 'shr_name'],//47
['field_name' => ' 城市', 'field_value' => 'shr_shi'],//48 ['field_name' => ' 省份', 'field_value' => 'shr_sheng'],//48
['field_name' => ' 区县', 'field_value' => 'shr_xian'],//49 ['field_name' => ' 城市', 'field_value' => 'shr_shi'],//49
['field_name' => ' 详细地址', 'field_value' => 'shr_adress'],//50 ['field_name' => ' 区县', 'field_value' => 'shr_xian'],//50
['field_name' => ' 结款类型', 'field_value' => 'mouth_pay'],//51 2022-05-05 dou ['field_name' => ' 详细地址', 'field_value' => 'shr_adress'],//51
['field_name' => ' 结款类型', 'field_value' => 'mouth_pay'],//52 2022-05-05 dou
//['field_name' => '商品名称', 'field_value' => 'goods_name'],//4 //['field_name' => '商品名称', 'field_value' => 'goods_name'],//4
......
...@@ -80,17 +80,17 @@ class MyTestController extends Controller ...@@ -80,17 +80,17 @@ class MyTestController extends Controller
$html .= "<td>总推送单量</td><td>接单量</td><td>拒单量</td><td>拒单率</td><td>接单时效</td><td>履约时效</td><td>总推送单量</td><td>接单量</td><td>拒单量</td><td>拒单率</td><td>接单时效</td><td>履约时效</td>"; $html .= "<td>总推送单量</td><td>接单量</td><td>拒单量</td><td>拒单率</td><td>接单时效</td><td>履约时效</td><td>总推送单量</td><td>接单量</td><td>拒单量</td><td>拒单率</td><td>接单时效</td><td>履约时效</td>";
$html .= "</tr>"; $html .= "</tr>";
foreach($admindata as $k => $v){ foreach($admindata as $k => $v){
$order_listnum = OrderList::whereRaw("ser_id='".$v['id']."' and create_time BETWEEN '".$time_start."' and '".$time_end."' and is_delete=1 and get_time != ''")->count();//接单数量 $order_listnum = OrderList::whereRaw("ser_id='".$v['id']."' and create_time BETWEEN '".$time_start."' and '".$time_end."' and is_delete=1 and get_time != '' and company_id = '".$input['company_id']."'")->count();//接单数量
$order_rejectednum = OrderRejected::whereRaw("or_ser_id='".$v['id']."' and or_creact_time BETWEEN '".$time_start."' and '".$time_end."' and or_show=1")->count();//拒单数量 $order_rejectednum = OrderRejected::whereRaw("or_ser_id='".$v['id']."' and or_creact_time BETWEEN '".$time_start."' and '".$time_end."' and or_show=1")->count();//拒单数量
$order_listAllnum = OrderList::whereRaw("ser_id='".$v['id']."' and create_time BETWEEN '2024-08-19' and '".$time_end."' and is_delete=1 and get_time != ''")->count();//总接单数量 $order_listAllnum = OrderList::whereRaw("ser_id='".$v['id']."' and create_time BETWEEN '2024-08-19' and '".$time_end."' and is_delete=1 and get_time != '' and company_id = '".$input['company_id']."'")->count();//总接单数量
$order_rejectedAllnum = OrderRejected::whereRaw("or_ser_id='".$v['id']."' and or_creact_time BETWEEN '2024-08-19' and '".$time_end."' and or_show=1")->count();//总拒单数量 $order_rejectedAllnum = OrderRejected::whereRaw("or_ser_id='".$v['id']."' and or_creact_time BETWEEN '2024-08-19' and '".$time_end."' and or_show=1")->count();//总拒单数量
$sql = "SELECT CAST((SUM(UNIX_TIMESTAMP(feeds_time))-SUM(UNIX_TIMESTAMP(get_time)))/COUNT(id) as SIGNED) as timenum FROM gone_order_list WHERE ser_id='".$v['id']."' and get_time != '' and get_time!='0000-00-00 00:00:00' and feeds_time != '' and feeds_time!='0000-00-00 00:00:00' and create_time BETWEEN '".$time_start."' and '".$time_end."' and is_delete=1"; $sql = "SELECT CAST((SUM(UNIX_TIMESTAMP(feeds_time))-SUM(UNIX_TIMESTAMP(get_time)))/COUNT(id) as SIGNED) as timenum FROM gone_order_list WHERE ser_id='".$v['id']."' and get_time != '' and get_time!='0000-00-00 00:00:00' and feeds_time != '' and feeds_time!='0000-00-00 00:00:00' and create_time BETWEEN '".$time_start."' and '".$time_end."' and is_delete=1 and company_id = '".$input['company_id']."'";
$data = DB::select($sql); $data = DB::select($sql);
$sql1 = "SELECT CAST((SUM(UNIX_TIMESTAMP(get_time))-SUM(UNIX_TIMESTAMP(create_time)))/COUNT(id) as SIGNED) as pdnum FROM gone_order_list WHERE ser_id='".$v['id']."' and get_time != '' and get_time!='0000-00-00 00:00:00' and create_time BETWEEN '".$time_start."' and '".$time_end."' and time(create_time)>='08:30:00' and time(create_time)<='18:00:00' and is_delete=1"; $sql1 = "SELECT CAST((SUM(UNIX_TIMESTAMP(get_time))-SUM(UNIX_TIMESTAMP(create_time)))/COUNT(id) as SIGNED) as pdnum FROM gone_order_list WHERE ser_id='".$v['id']."' and get_time != '' and get_time!='0000-00-00 00:00:00' and create_time BETWEEN '".$time_start."' and '".$time_end."' and time(create_time)>='08:30:00' and time(create_time)<='18:00:00' and is_delete=1 and company_id = '".$input['company_id']."'";
$data1 = DB::select($sql1); $data1 = DB::select($sql1);
$sqls = "SELECT CAST((SUM(UNIX_TIMESTAMP(feeds_time))-SUM(UNIX_TIMESTAMP(get_time)))/COUNT(id) as SIGNED) as timenum FROM gone_order_list WHERE ser_id='".$v['id']."' and create_time BETWEEN '2024-08-19' and '".$time_end."' and get_time != '' and get_time!='0000-00-00 00:00:00' and feeds_time != '' and feeds_time!='0000-00-00 00:00:00' and is_delete=1";// and is_delete=1 $sqls = "SELECT CAST((SUM(UNIX_TIMESTAMP(feeds_time))-SUM(UNIX_TIMESTAMP(get_time)))/COUNT(id) as SIGNED) as timenum FROM gone_order_list WHERE ser_id='".$v['id']."' and create_time BETWEEN '2024-08-19' and '".$time_end."' and get_time != '' and get_time!='0000-00-00 00:00:00' and feeds_time != '' and feeds_time!='0000-00-00 00:00:00' and is_delete=1 and company_id = '".$input['company_id']."'";// and is_delete=1
$datas = DB::select($sqls); $datas = DB::select($sqls);
$sqls1 = "SELECT CAST((SUM(UNIX_TIMESTAMP(get_time))-SUM(UNIX_TIMESTAMP(create_time)))/COUNT(id) as SIGNED) as pdnum FROM gone_order_list WHERE ser_id='".$v['id']."' and create_time BETWEEN '2024-08-19' and '".$time_end."' and get_time != '' and get_time!='0000-00-00 00:00:00' and time(create_time)>='08:30:00' and time(create_time)<='18:00:00' and is_delete=1";// and is_delete=1 $sqls1 = "SELECT CAST((SUM(UNIX_TIMESTAMP(get_time))-SUM(UNIX_TIMESTAMP(create_time)))/COUNT(id) as SIGNED) as pdnum FROM gone_order_list WHERE ser_id='".$v['id']."' and create_time BETWEEN '2024-08-19' and '".$time_end."' and get_time != '' and get_time!='0000-00-00 00:00:00' and time(create_time)>='08:30:00' and time(create_time)<='18:00:00' and is_delete=1 and company_id = '".$input['company_id']."'";// and is_delete=1
$datas1 = DB::select($sqls1); $datas1 = DB::select($sqls1);
$html .= "<tr>"; $html .= "<tr>";
$html .= "<td>".$v['id']."</td>"; $html .= "<td>".$v['id']."</td>";
......
...@@ -130,7 +130,7 @@ class StatementsListController extends BaseController{ ...@@ -130,7 +130,7 @@ class StatementsListController extends BaseController{
$wats = rtrim($wats,',');*/ $wats = rtrim($wats,',');*/
if ($session['admin_groupnew'] != 7){//管理员可以看全部 if ($session['admin_groupnew'] != 7){//管理员可以看全部
$sqlnew = "select gone_settlement_list.*,d.p_price,d.wat_num as wat_three from gone_settlement_list left join gone_statements_list on gone_settlement_list.wat_num = gone_statements_list.stl_wat LEFT JOIN gone_settlement_three as d on gone_settlement_list.list_id=d.list_id where company_id='". $session['company_id']."' gone_statements_list.stl_endtime Between '". $stl_startime."'and '". $stl_endtime."'"; $sqlnew = "select gone_settlement_list.*,d.p_price,d.wat_num as wat_three from gone_settlement_list left join gone_statements_list on gone_settlement_list.wat_num = gone_statements_list.stl_wat LEFT JOIN gone_settlement_three as d on gone_settlement_list.list_id=d.list_id where gone_settlement_list.company_id='". $session['company_id']."' and gone_statements_list.stl_endtime Between '". $stl_startime."'and '". $stl_endtime."'";
}else{ }else{
$sqlnew = "select gone_settlement_list.*,d.p_price,d.wat_num as wat_three from gone_settlement_list left join gone_statements_list on gone_settlement_list.wat_num = gone_statements_list.stl_wat LEFT JOIN gone_settlement_three as d on gone_settlement_list.list_id=d.list_id where gone_statements_list.stl_endtime Between '". $stl_startime."'and '". $stl_endtime."'"; $sqlnew = "select gone_settlement_list.*,d.p_price,d.wat_num as wat_three from gone_settlement_list left join gone_statements_list on gone_settlement_list.wat_num = gone_statements_list.stl_wat LEFT JOIN gone_settlement_three as d on gone_settlement_list.list_id=d.list_id where gone_statements_list.stl_endtime Between '". $stl_startime."'and '". $stl_endtime."'";
} }
......
...@@ -146,16 +146,17 @@ class AotuorderController extends BaseController ...@@ -146,16 +146,17 @@ class AotuorderController extends BaseController
if($sheng == '江苏' || $sheng == '江苏省'){ if($sheng == '江苏' || $sheng == '江苏省'){
$where = ' and (admin_groupnew=3 or (admin_groupnew=2 and company_type=2))'; $where = ' and (admin_groupnew=3 or (admin_groupnew=2 and company_type=2))';
}else{ }else{
$where = ' and admin_groupnew=2 and company_type=1 and company_id='.$order['company_id'];
if($order['company_id']==14){ if($order['company_id']==14){
$where = $where." or admin.id in (91)"; $where = ' and ((admin_groupnew=2 and company_type=1 and company_id='.$order['company_id'].') or id in (91))';
}else{
$where = ' and admin_groupnew=2 and company_type=1 and company_id='.$order['company_id'];
} }
} }
if(empty($or_ser_id)) { if(empty($or_ser_id)) {
if ($xian == 1) { if ($xian == 1) {
CommonService::startmysql(); CommonService::startmysql();
$ser = Bserviss::leftJoin('admin','admin.id','=','bservisnew.bs_serid')->whereRaw("find_in_set('" . $dress['are_id'] . "',bs_areid) and bs_branid='" . $goodid . "' and bs_status='1' and enable=1".$where)->select('bservisnew.*','admin_groupnew')->get()->toArray(); $ser = Bserviss::leftJoin('admin','admin.id','=','bservisnew.bs_serid')->whereRaw("find_in_set('" . $dress['are_id'] . "',bs_areid) and bs_branid='" . $goodid . "' and bs_status='1' and enable=1".$where)->select('bservisnew.*','admin_groupnew')->get()->toArray();
CommonService::addLog('自动拒单', CommonService::showmysql(), '','AotuorderController'); CommonService::addLog('自动派单', CommonService::showmysql(), $sys_num,'AotuorderController');
if (!$ser) { if (!$ser) {
$ser = Bserviss::leftJoin('admin','admin.id','=','bservisnew.bs_serid')->whereRaw("bs_sid='" . $dress['are_sid'] . "' and bs_branid='" . $goodid . "' and bs_status='1' and enable=1".$where)->select('bservisnew.*','admin_groupnew')->get()->toArray(); $ser = Bserviss::leftJoin('admin','admin.id','=','bservisnew.bs_serid')->whereRaw("bs_sid='" . $dress['are_sid'] . "' and bs_branid='" . $goodid . "' and bs_status='1' and enable=1".$where)->select('bservisnew.*','admin_groupnew')->get()->toArray();
$xian = 2; $xian = 2;
...@@ -163,7 +164,7 @@ class AotuorderController extends BaseController ...@@ -163,7 +164,7 @@ class AotuorderController extends BaseController
} else { } else {
CommonService::startmysql(); CommonService::startmysql();
$ser = Bserviss::leftJoin('admin','admin.id','=','bservisnew.bs_serid')->whereRaw("bs_sid='" . $dress['are_sid'] . "' and bs_branid='" . $goodid . "' and bs_status='1' and enable=1".$where)->select('bservisnew.*','admin_groupnew')->get()->toArray(); $ser = Bserviss::leftJoin('admin','admin.id','=','bservisnew.bs_serid')->whereRaw("bs_sid='" . $dress['are_sid'] . "' and bs_branid='" . $goodid . "' and bs_status='1' and enable=1".$where)->select('bservisnew.*','admin_groupnew')->get()->toArray();
CommonService::addLog('自动拒单', CommonService::showmysql(), '','AotuorderController'); CommonService::addLog('自动派单', CommonService::showmysql(), $sys_num,'AotuorderController');
} }
}else{ }else{
if ($xian == 1) { if ($xian == 1) {
......
...@@ -43,7 +43,7 @@ class LoginService ...@@ -43,7 +43,7 @@ class LoginService
->leftJoin('admin_infor as adin', 'adin.admin_id', '=', 'adm.id') ->leftJoin('admin_infor as adin', 'adin.admin_id', '=', 'adm.id')
->where('admin_acc', $request['account']) ->where('admin_acc', $request['account'])
->where('company_id', $company_id) ->where('company_id', $company_id)
->whereIn('admin_groupnew', [2,3]) ->whereIn('admin_groupnew', [2,3,4])
->where('admin_password', $password) ->where('admin_password', $password)
->select('adm.id', 'admin_acc as check_code', 'admin_name as install_name', 'phone as install_phone', 'enable as install_is_type', 'adm.id as admin_id','admin_groupnew','company_id') ->select('adm.id', 'admin_acc as check_code', 'admin_name as install_name', 'phone as install_phone', 'enable as install_is_type', 'adm.id as admin_id','admin_groupnew','company_id')
->first(); ->first();
......
...@@ -151,10 +151,10 @@ class OrderListService extends Model ...@@ -151,10 +151,10 @@ class OrderListService extends Model
$list_items[$key]['button'][] = ['action'=>'copyInfo','name'=>'复制信息']; $list_items[$key]['button'][] = ['action'=>'copyInfo','name'=>'复制信息'];
}else { }else {
if($session['user_type']==3 && $value['ser_id']==$session['admin_id']){
$list_items[$key]['button'][] = ['action'=>'sendAgain','name'=>'指派门店'];
}
if ($request['stauas'] == 2) { if ($request['stauas'] == 2) {
if($session['user_type']==3 && $value['ser_id']==$session['admin_id']){
$list_items[$key]['button'][] = ['action'=>'sendAgain','name'=>'指派门店'];
}
if ($session['user_type'] != 1) { if ($session['user_type'] != 1) {
$list_items[$key]['button'][] = ['action' => 'transferOfOrder', 'name' => '改派']; $list_items[$key]['button'][] = ['action' => 'transferOfOrder', 'name' => '改派'];
} }
...@@ -862,6 +862,10 @@ class OrderListService extends Model ...@@ -862,6 +862,10 @@ class OrderListService extends Model
$data['button'][] = ['action' => 'contact', 'name' => '预约时间']; $data['button'][] = ['action' => 'contact', 'name' => '预约时间'];
} }
} }
if($session['user_type']==3 && $orderListArr['ser_id']==$session['admin_id']){
$data['button'][] = ['action'=>'sendAgain','name'=>'指派门店'];
}
} }
if ($request['stauas'] == 3) { if ($request['stauas'] == 3) {
if (isset($installLine)) { if (isset($installLine)) {
...@@ -891,9 +895,6 @@ class OrderListService extends Model ...@@ -891,9 +895,6 @@ class OrderListService extends Model
$data['button'][] = ['action' => 'contact', 'name' => '预约时间']; $data['button'][] = ['action' => 'contact', 'name' => '预约时间'];
} }
} }
if($session['user_type']==3 && $orderListArr['ser_id']==$session['admin_id']){
$data['button'][] = ['action'=>'sendAgain','name'=>'指派门店'];
}
$data['button'][] = ['action' => 'copyInfo', 'name' => '复制信息']; $data['button'][] = ['action' => 'copyInfo', 'name' => '复制信息'];
} }
}elseif($orderListArr['stauas'] == 34 || $orderListArr['stauas'] == 40){ }elseif($orderListArr['stauas'] == 34 || $orderListArr['stauas'] == 40){
...@@ -1405,7 +1406,7 @@ class OrderListService extends Model ...@@ -1405,7 +1406,7 @@ class OrderListService extends Model
$input['shi'] = $request['shi']; $input['shi'] = $request['shi'];
$input['xian'] = $request['xian']; $input['xian'] = $request['xian'];
$input['address'] = $request['address']; $input['address'] = $request['address'];
$data = OrderService::getService($input,$session); $data = OrderService::getService($input);
return $data; return $data;
}else { }else {
$list = Admin::whereIn('admin_groupnew', [2, 3]) $list = Admin::whereIn('admin_groupnew', [2, 3])
......
...@@ -1646,9 +1646,22 @@ class OrderService extends Service ...@@ -1646,9 +1646,22 @@ class OrderService extends Service
} }
if ($session && $session['admin_groupnew'] != 7) {//管理员可以看全部 if ($session && $session['admin_groupnew'] != 7) {//管理员可以看全部
$where['company_id'] = $session['company_id']; //2022-11-3 获取服务商可不用分公司 // $where['company_id'] = $session['company_id']; //2022-11-3 获取服务商可不用分公司
$where['company_type'] = 1; // $where['company_type'] = 1;
$where['admin_groupnew'] = 2; // $where['admin_groupnew'] = 2;
if($session['company_id']==14){
$wherecompany1['company_id'] = $session['company_id'];
$wherecompany1['company_type'] = 1;
$wherecompany1['admin_groupnew'] = 2;
$wherecompany2['id_searchin'] = [91];
$where['wherecompany_searchor']['wherecompany1_next_level'] = $wherecompany1;
$where['wherecompany_searchor']['wherecompany2_next_level'] = $wherecompany2;
}else {
$where['company_id'] = $session['company_id'];
$where['company_type'] = 1;
$where['admin_groupnew'] = 2;
}
} }
$list = AdminsService::getAdmins($where,['id','company_name','is_lidao','owner','children_id','ad_brand','ad_project','brand_service'],['is_sord'=>'DESC']); $list = AdminsService::getAdmins($where,['id','company_name','is_lidao','owner','children_id','ad_brand','ad_project','brand_service'],['is_sord'=>'DESC']);
...@@ -1798,9 +1811,18 @@ class OrderService extends Service ...@@ -1798,9 +1811,18 @@ class OrderService extends Service
} }
if ($session && $session['admin_groupnew'] != 7) {//管理员可以看全部 if ($session && $session['admin_groupnew'] != 7) {//管理员可以看全部
$where['company_id'] = $session['company_id']; if($session['company_id']==14){
$where['company_type'] = 1; $wherecompany1['company_id'] = $session['company_id'];
$where['admin_groupnew'] = 2; $wherecompany1['company_type'] = 1;
$wherecompany1['admin_groupnew'] = 2;
$wherecompany2['id_searchin'] = [91];
$where['wherecompany_searchor']['wherecompany1_next_level'] = $wherecompany1;
$where['wherecompany_searchor']['wherecompany2_next_level'] = $wherecompany2;
}else {
$where['company_id'] = $session['company_id'];
$where['company_type'] = 1;
$where['admin_groupnew'] = 2;
}
} }
CommonService::startmysql(); CommonService::startmysql();
$list = AdminsService::getAdmins($where,['id','company_name','is_lidao','owner','children_id','ad_brand','ad_project','brand_service'],['is_sord'=>'DESC']); $list = AdminsService::getAdmins($where,['id','company_name','is_lidao','owner','children_id','ad_brand','ad_project','brand_service'],['is_sord'=>'DESC']);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论