作者 魏强

后台接口调试修改

... ... @@ -216,9 +216,9 @@ class AlipaywapController extends NotifyCommonController
$this->changeOrderStatus($where,$data['trade_no'],4,'手机支付宝支付');
$status = Db::name('Order')->where($where)->value('status');
if($status == 2) {
$this->redirect('http://'.$_SERVER['HTTP_HOST']);
$this->redirect('http://m.bifangjia.com/');
} else {
$this->redirect('http://'.$_SERVER['HTTP_HOST']);
$this->redirect('http://m.bifangjia.com/');
}
}
}
... ...
... ... @@ -40,7 +40,7 @@ class CommonController extends HomeBaseController
$firstMember = Db::name('Member')->where($where_firstMember)->field('id,update_time,status')->find();
if($firstMember){
if($firstMember['status'] == 8){
$this->apiResponse('0','您已被拉黑,请联系管理员');
$this->apiResponse('-2','您已被拉黑,请联系管理员');
}else{
if(($firstMember['update_time']+604800) < time() ){
$firstStr = rand(1000,9999).time().rand(100,999);
... ... @@ -191,11 +191,15 @@ class CommonController extends HomeBaseController
$middle_str .= $spv;
}
}
$resStr = $middle_str.'-万元';
// $resStr = $middle_str.'-万元';
$resStr = $middle_str;
}else{
$resStr = $exp[0].'-元';
// $resStr = $exp[0].'-元';
$resStr = $numb/10000;
}
$return = $middle_str;
return $return;
return $resStr;
}
}
... ...
... ... @@ -63,6 +63,11 @@ class IndexController extends CommonController
$final['new'] = Db::name('New')->where($where_new)->order('score desc')->select()->toArray();
// 4. 合作企业
$where_coo['status'] = 1;
if(!empty($getParam['chooseType'])){
$where_coo['type'] = $getParam['chooseType'];
}else{
$this->apiResponse('0','类型错误');
}
$final['coop'] = Db::name('Cooperation')->where($where_coo)->order("score desc , create_time desc")->field('pic,jump')->limit(10)->select()->toArray();
foreach ($final['coop'] as $coopk=>$coopv){
if(empty($coopv['pic'])){
... ...
... ... @@ -376,6 +376,7 @@ class IntermediaryController extends CommonController
if($is_order){
$final['is_see'] = 2;
$final['money'] = $this->getLowStr($is_order['money']);
// $final['money'] = $is_order['money'];
$final['pay_time'] = $is_order['create_time'];
}else{
$where_agency['need_id'] = $request->param('need_id');
... ... @@ -386,6 +387,7 @@ class IntermediaryController extends CommonController
$money = $this->getOrderInfo($token,$need_id);
$final['is_see'] = 1;
$final['money'] = $this->getLowStr($money['money']);
// $final['money'] = $money['money'];
$final['pay_time'] = $money['pay_time'];
}else{
$final['is_see'] = 0;
... ... @@ -436,19 +438,23 @@ class IntermediaryController extends CommonController
->select()->toArray();
$final_list = array();
$add_arr = array();
$is_trueMoney = array();
if($agency_list){
foreach ($agency_list as $agencyk=>$agencyv){
$final_list[$agencyk]['need_id'] = $need_id;
$final_list[$agencyk]['agency_id'] = $agencyv['id'];
$final_list[$agencyk]['user_id'] = $user_id;
$money = $agencyv['housing_price'] + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'] ;
$money_arr[] = $money;
$fianlMoney = substr($money, 0,-4);
$final_list[$agencyk]['true_money'] = $money;
$final_list[$agencyk]['money'] = $fianlMoney;
if($money > 100000){
$agencyv['need_id'] = $need_id;
$agencyv['agency_id'] = $agencyv['id'];
$agencyv['user_id'] = $user_id;
$money_arr[] = $money;
$fianlMoney = substr($money, 0,-4);
$agencyv['true_money'] = $money;
$agencyv['money'] = $money;
$is_trueMoney[] = $agencyv;
}
}
sort($money_arr);
foreach ($final_list as $finalk=>$finalv){
foreach ($is_trueMoney as $finalk=>$finalv){
if($finalv['true_money'] == $money_arr[0]){
$add_arr['need_id'] = $finalv['need_id'];
$add_arr['agency_id'] = $finalv['agency_id'];
... ... @@ -467,8 +473,6 @@ class IntermediaryController extends CommonController
}
// 透视卡
//token
//need_id
... ... @@ -553,8 +557,9 @@ class IntermediaryController extends CommonController
->count();
$final['all_page'] = ceil($number/$size);
foreach ($need as $nk=>$nv){
$changeInt = (int)$nv['all_price'];
$need[$nk]['intPrice'] = substr($changeInt,0,-4);
// $str = (string)$nv['all_price'];
$changeInt = explode('.',$nv['all_price']);
$need[$nk]['intPrice'] = substr($changeInt[0],0,-4);
}
$final['need'] = $need;
}else{
... ... @@ -674,6 +679,17 @@ class IntermediaryController extends CommonController
$where_member['status'] = 1;
$member = Db::name('Member')->where($where_member)->find();
if(!empty($data['company'])){
if(empty($data['store'])){
$this->apiResponse('0','请输入所在门店');
}
if(empty($data['quarters'])){
$this->apiResponse('0','请输入服务小区');
}else{
$qua_len = mb_strlen($data['quarters'],'utf-8');
if($qua_len > 12){
$this->apiResponse('0','服务小区最多12个字符');
}
}
$update_member['company'] = $data['company'];
$update_member['id'] = $member['id'];
$update_member['store'] = $data['store'];
... ...
... ... @@ -128,19 +128,23 @@ class NotifyCommonController extends HomeBaseController
->select()->toArray();
$final_list = array();
$add_arr = array();
$is_trueMoney = array();
if($agency_list){
foreach ($agency_list as $agencyk=>$agencyv){
$final_list[$agencyk]['need_id'] = $need_id;
$final_list[$agencyk]['agency_id'] = $agencyv['id'];
$final_list[$agencyk]['user_id'] = $user_id;
$money = $agencyv['housing_price']*10000 + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'] ;
$money_arr[] = $money;
$fianlMoney = substr($money, 0,-4);
$final_list[$agencyk]['true_money'] = $money;
$final_list[$agencyk]['money'] = $fianlMoney;
$money = $agencyv['housing_price'] + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'] ;
if($money > 100000){
$agencyv['need_id'] = $need_id;
$agencyv['agency_id'] = $agencyv['id'];
$agencyv['user_id'] = $user_id;
$money_arr[] = $money;
$fianlMoney = substr($money, 0,-4);
$agencyv['true_money'] = $money;
$agencyv['money'] = $money;
$is_trueMoney[] = $agencyv;
}
}
sort($money_arr);
foreach ($final_list as $finalk=>$finalv){
foreach ($is_trueMoney as $finalk=>$finalv){
if($finalv['true_money'] == $money_arr[0]){
$add_arr['need_id'] = $finalv['need_id'];
$add_arr['agency_id'] = $finalv['agency_id'];
... ... @@ -158,4 +162,5 @@ class NotifyCommonController extends HomeBaseController
}
}
}
\ No newline at end of file
... ...
... ... @@ -81,7 +81,7 @@ class ThirdsendController extends HomeBaseController
// $final_list[$agencyk] = $agencyv;
// $final_list[$agencyk]['agency_id'] = $agencyv['id'];
// $final_list[$agencyk]['user_id'] = $user_id;
$money = $agencyv['housing_price']*10000 + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'] ;
$money = $agencyv['housing_price'] + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'] ;
$money_arr[] = $money;
$fianlMoney = substr($money, 0,-4);
$agency_list[$agencyk]['true_money'] = $money;
... ... @@ -144,7 +144,7 @@ class ThirdsendController extends HomeBaseController
$userNeedList = Db::name('UserNeed')->where($where_need)->field('id,pay_time')->find();
if(!empty($userNeedList)) {
$time = time();
$sendTime = intval($userNeedList['pay_time']+1797);
$sendTime = intval($userNeedList['pay_time']+1780);
if($time < $sendTime){
$this->apiResponse('0','未到发布时间',['now'=>$time,'pay'=>$sendTime]);
}else{
... ... @@ -201,7 +201,7 @@ class ThirdsendController extends HomeBaseController
$userNeedList['user_type'] = Db::name('Member')->where(['id'=>$userNeedList['user_id']])->value('type');
$time = time();
// 查询相应报价
$final_time = $userNeedList['pay_time'] + $userNeedList['quotation_time'] * 86400;
$final_time = $userNeedList['pay_time'] + $userNeedList['quotation_time'] * 86400 + 1800;
// 判断时间是否正确
if ($time >= $final_time) {
// 处理未支付报价
... ... @@ -235,10 +235,16 @@ class ThirdsendController extends HomeBaseController
$get_list = array();
// 删除十万以内报价
foreach ($agency_list as $tenk=>$tenv){
$ten_money = $tenv['housing_price'] * 10000 + $tenv['assessment_tax'] + $tenv['security_tax'] + $tenv['else_tax'] + $tenv['service_charge'];
$ten_money = $tenv['housing_price'] + $tenv['assessment_tax'] + $tenv['security_tax'] + $tenv['else_tax'] + $tenv['service_charge'];
if($ten_money > 100000){
$is_trueMoney[] = $tenv;
} else {
$up_agen['id'] = $tenv['id'];
$up_agen_res['status'] = 3;
$res_up = Db::name('Agency')->where($up_agen)->update($up_agen_res);
if(!$res_up){
Db::rollback();
}
$this->agency_order_refund($tenv,'中介报价未进入决赛圈退款',2);
}
}
... ... @@ -251,7 +257,7 @@ class ThirdsendController extends HomeBaseController
// 判断是否在品牌企业中
if (strstr($brav, $agencyv['company']) !== false) {
// 存在
$agen_money = $agencyv['housing_price'] * 10000 + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
$agen_money = $agencyv['housing_price'] + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
if (empty($agen_arr)) {
$agen_arr[0]['money'] = $agen_money;
$agen_arr[0]['id'] = $agencyv['id'];
... ... @@ -266,7 +272,7 @@ class ThirdsendController extends HomeBaseController
}
}
// 取出前三报价
$money = $agencyv['housing_price'] * 10000 + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
$money = $agencyv['housing_price'] + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
$money_list[$agencyv['id']] = $money;
}
asort($money_list);
... ... @@ -653,7 +659,7 @@ class ThirdsendController extends HomeBaseController
// 循环需求,查询相应报价
foreach ($userNeedList as $uNeedk => $uNeedv) {
$uNeedv['user_type'] = Db::name('Member')->where(['id'=>$uNeedv['user_id']])->value('type');
$final_time = $uNeedv['pay_time'] + $uNeedv['quotation_time'] * 86400;
$final_time = $uNeedv['pay_time'] + $uNeedv['quotation_time'] * 86400 + 1800;
if ($time >= $final_time) {
// 处理未支付报价
$not_pay = Db::name('Agency')->where(['need_id'=>$uNeedv['id'],'status'=>1])->column('id');
... ... @@ -686,10 +692,16 @@ class ThirdsendController extends HomeBaseController
if ($agency_list) {
// 删除十万以内报价
foreach ($agency_list as $tenk=>$tenv){
$ten_money = $tenv['housing_price'] * 10000 + $tenv['assessment_tax'] + $tenv['security_tax'] + $tenv['else_tax'] + $tenv['service_charge'];
$ten_money = $tenv['housing_price'] + $tenv['assessment_tax'] + $tenv['security_tax'] + $tenv['else_tax'] + $tenv['service_charge'];
if($ten_money > 100000){
$is_trueMoney[] = $tenv;
} else {
$up_agen['id'] = $tenv['id'];
$up_agen_res['status'] = 3;
$res_up = Db::name('Agency')->where($up_agen)->update($up_agen_res);
if(!$res_up){
Db::rollback();
}
$this->agency_order_refund($tenv,'中介报价未进入决赛圈退款',2);
}
}
... ... @@ -703,7 +715,7 @@ class ThirdsendController extends HomeBaseController
// 判断是否在品牌企业中
if (strstr($brav, $agencyv['company']) !== false) {
// 存在
$agen_money = $agencyv['housing_price'] * 10000 + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
$agen_money = $agencyv['housing_price'] + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
if (empty($agen_arr)) {
$agen_arr[0]['money'] = $agen_money;
$agen_arr[0]['id'] = $agencyv['id'];
... ... @@ -718,7 +730,7 @@ class ThirdsendController extends HomeBaseController
}
}
// 取出前三报价
$money = $agencyv['housing_price'] * 10000 + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
$money = $agencyv['housing_price'] + $agencyv['assessment_tax'] + $agencyv['security_tax'] + $agencyv['else_tax'] + $agencyv['service_charge'];
$money_list[$agencyv['id']] = $money;
}
asort($money_list);
... ... @@ -1319,6 +1331,7 @@ class ThirdsendController extends HomeBaseController
// 添加推荐人余额
public function handle($need,$agency)
{
... ...
... ... @@ -397,7 +397,7 @@ class UserController extends CommonController
$where_member['tel'] = $tel;
$where_member['password'] = $this->md5($password);
// $where_member['type'] = $getData['gener'];
$uid = Db::name('Member')->where($where_member)->field('id,token,type,login_time')->find();
$uid = Db::name('Member')->where($where_member)->field('id,token,type,login_time,status')->find();
if($uid['type'] != $getData['gener']){
if($uid['type'] == 1){
$this->apiResponse('0','请去用户登录页面登录');
... ... @@ -405,6 +405,9 @@ class UserController extends CommonController
$this->apiResponse('0','请去中介登录页面登录');
}
}
if($uid['status'] == 8){
$this->apiResponse('0','您已被拉黑,请联系管理员');
}
if($uid){
// 登录重置token
$token_str = rand(1000,9999).time().rand(100,999);
... ... @@ -1174,10 +1177,12 @@ class UserController extends CommonController
if($userNeed['status'] == 7){
$where_agency['a.need_id'] = $data['need_id'];
$where_agency['a.status'] = ['in','5,6'];
$final['is_choose'] = 1;
}else{
// 待选择中介
$where_agency['a.need_id'] = $data['need_id'];
$where_agency['a.status'] = 4;
$final['is_choose'] = 0;
}
// 查询报价
... ... @@ -1440,6 +1445,12 @@ class UserController extends CommonController
if(empty($data['content'])){
$this->apiResponse('0','评论内容不能为空');
}
if($data['content']){
$mb_len = mb_strlen($data['content'],'utf-8');
if($mb_len >100){
$this->apiResponse('0','评论内容不能超过100个字');
}
}
$where_need['status'] = 10;
$where_need['id'] = $data['need_id'];
$need = Db::name('UserNeed')->where($where_need)->find();
... ... @@ -1684,10 +1695,19 @@ class UserController extends CommonController
$where_umoney['user_id'] = $user['id'];
$where_umoney['status'] = array('neq',9);
$where_umoney['order_type'] = array('in','6,7');
$order_list = Db::name('MoneyDetail')->where($where_umoney)->field('id,title,money,update_time,type')->select()->toArray();
$order_list = Db::name('MoneyDetail')->where($where_umoney)->field('id,title,money,update_time,type,status')->select()->toArray();
$final['user'] = $user;
if($order_list){
foreach ($order_list as $ordk=>$ordv){
if($ordv['status'] == 4){
$order_list[$ordk]['title'] = '提现失败';
$order_list[$ordk]['money'] = 0;
}else if($ordv['status'] == 5){
$order_list[$ordk]['title'] = '提现中...';
}else if($ordv['status'] == 3){
$order_list[$ordk]['title'] = '提现成功';
}
$order_list[$ordk]['update_time'] = date('Y-m-d H:i:s',$ordv['update_time']);
}
$final['detail'] = $order_list;
... ...
... ... @@ -59,6 +59,7 @@ class ComplaintController extends AdminBaseController
->join("Member m",'m.id = c.user_id')
->where($where_money)
->field("m.name,m.tel,c.*")
->order('c.create_time desc')
->paginate(10,false,['query'=>$arr]);
$page = $money_list->render();
$this->assign('page',$page);
... ...
... ... @@ -101,6 +101,7 @@ class CooperationController extends AdminBaseController
$change_add['pic'] = $data['pic'];
$change_add['score'] = $data['score'];
$change_add['jump'] = $data['jump'];
$change_add['type'] = $data['type'];
$validate = Loader::validate('Cooperation');
if(!$validate->scene('edit')->check($change_add)){
$mes = $validate->getError();
... ... @@ -115,6 +116,7 @@ class CooperationController extends AdminBaseController
$add['pic'] = $data['pic'];
$add['score'] = $data['score'];
$add['jump'] = $data['jump'];
$add['type'] = $data['type'];
$validate = Loader::validate('Cooperation');
if(!$validate->scene('add')->check($add)){
$mes = $validate->getError();
... ...
... ... @@ -207,6 +207,7 @@ class NeedController extends AdminBaseController
$changeNeed = Db::name('UserNeed')->where($where_need)->update($save_need);
// 修改报价状态
$where_agency['need_id'] = $data['need_id'];
$where_agency['status'] = array('in','5,6');
$save_agency['status'] = 4;
$save_agency['update_time'] = time();
$save_agency['choose_time'] = '';
... ...
... ... @@ -59,6 +59,7 @@ class RefundController extends AdminBaseController
->join("Member m",'m.id = r.user_id')
->where($where_money)
->field("m.name,m.tel,r.*")
->order('r.create_time desc')
->paginate(10,false,['query'=>$arr]);
$page = $money_list->render();
$this->assign('page',$page);
... ...
... ... @@ -60,10 +60,13 @@ class GetmoneyController extends AdminBaseController
$where_money['d.order_type'] = 6;
$where_money['d.type'] = 3;
$where_money['d.status'] = array('neq',9);
$where_money['c.status'] = array('neq',9);
$money_list = Db::name('MoneyDetail')->alias('d')
->join("Member m",'m.id = d.user_id')
->join("Card c",'c.user_id = m.id')
->where($where_money)
->field("m.name,m.tel,m.type,d.money,d.status,d.id,d.create_time")
->field("m.name,m.tel,m.type,d.money,d.status,d.id,d.create_time,c.card_num")
->order('create_time desc')
->paginate(10,false,['query'=>$arr]);
$page = $money_list->render();
$this->assign('page',$page);
... ... @@ -87,6 +90,11 @@ class GetmoneyController extends AdminBaseController
$save['status'] = 3;
$save['update_time'] = time();
$update = Db::name('MoneyDetail')->where($where_money)->update($save);
$where_member['id'] = $money['user_id'];
$add_g = Db::name('Member')->where($where_member)->setDec('get_money',$money['money']);
if(!$add_g){
$this->error('失败');
}
if($update){
$this->success('成功');
}else{
... ... @@ -107,6 +115,14 @@ class GetmoneyController extends AdminBaseController
$where_money['status'] = array('neq',9);
$money = Db::name('MoneyDetail')->where($where_money)->find();
if($money){
$where_member['id'] = $money['user_id'];
$up_money['money'] = $money['money'];
$up_money['get_money'] = $money['money'];
$add_m = Db::name('Member')->where($where_member)->setInc('money',$money['money']);
$add_g = Db::name('Member')->where($where_member)->setDec('get_money',$money['money']);
if(!$add_m && !$add_g){
$this->error('失败');
}
$save['status'] = 4;
$save['update_time'] = time();
$update = Db::name('MoneyDetail')->where($where_money)->update($save);
... ...
... ... @@ -18,6 +18,15 @@
<input class="form-control" type="hidden" name="id"
value="{$list['id']}"/>
<tr>
<th width="10%">类型</th>
<td>
<select name="type" style="border: 1px solid #dce4ec; width: 15%;">
<option name="type" value="1" <eq name="list.type" value="1">selected</eq>>手机端</option>
<option name="type" value="2" <eq name="list.type" value="2">selected</eq>>PC端</option>
</select>
</td>
</tr>
<tr>
<th>企业名称<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="title"
... ...
... ... @@ -75,7 +75,7 @@
<th>ID</th>
<th>报价id</th>
<th>评论人id</th>
<th>评论内容</th>
<th style="width: 25%;">评论内容123</th>
<th>是否已修改</th>
<th>评论状态</th>
<th>评论时间</th>
... ...
... ... @@ -123,7 +123,7 @@
<th>用户手机号</th>
<th>中介名</th>
<th>中介手机号</th>
<th>评论内容</th>
<th style="width: 25%;">评论内容</th>
<th>是否已修改</th>
<th>评论状态</th>
<th>评论时间</th>
... ...
... ... @@ -81,6 +81,7 @@
<th>ID</th>
<th>用户名</th>
<th>手机号</th>
<th>银行卡号</th>
<th>身份</th>
<th>提现金额</th>
<th>状态</th>
... ... @@ -94,6 +95,7 @@
<td>{$vo.id}</td>
<td>{$vo.name}</td>
<td>{$vo.tel}</td>
<td>{$vo.card_num}</td>
<td>
<eq name="vo.type" value="1">
用户
... ... @@ -111,13 +113,13 @@
<td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
<td>
<eq name="vo.status" value="3">
<span style="color: #00AA00; cursor: pointer; " index="{$vo.id}">提现通过</span>
<span style="color: #00AA00; cursor: pointer; " index="{$vo.id}">转账成功</span>
</eq>
<eq name="vo.status" value="4">
<span style="color: #ff0000; cursor: pointer; " index="{$vo.id}">未通过</span>
</eq>
<eq name="vo.status" value="5">
<span class="agree" style="color: #18BC9C; text-decoration:underline; cursor: pointer; " index="{$vo.id}">同意</span>
<span class="agree" style="color: #18BC9C; text-decoration:underline; cursor: pointer; " index="{$vo.id}">已转账</span>
<span class="refuse" style="color: #ff0000; text-decoration:underline; cursor: pointer; " index="{$vo.id}">拒绝</span>
</eq>
</td>
... ...