$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
@@ -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();
$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();
->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')