Commit 15d1565b authored by clone's avatar clone

Merge branch 'v0828-3.3.8' into test

# Conflicts: # application/api_broker/service/LookShopService.php # public/app/dist/index.html # public/appnew/src/components/achieveMain/achieveFork.vue # public/appnew/src/components/achieveMain/achieveRegion.vue
parents bcaf4475 800fedf4
......@@ -29,6 +29,7 @@ class OfficeBuilding extends Basic
*/
public function getOfficeBuildingInfo()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
$checkResult = $this->validate($params, "OfficeRoomValidate.getOfficeRoomInfo");
if (true !== $checkResult) {
......@@ -41,4 +42,5 @@ class OfficeBuilding extends Basic
return $this->response($result['status'], $result['msg'], $result['data']);
}
}
\ No newline at end of file
......@@ -36,6 +36,7 @@ class OfficeRoom extends Basic
*/
public function getOfficeRoomInfo()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
$checkResult = $this->validate($params, "OfficeRoomValidate.getOfficeRoomInfo");
......@@ -56,6 +57,7 @@ class OfficeRoom extends Basic
*/
public function getBuildingRoomList()
{
header('Access-Control-Allow-Origin:*');
$result = $this->serviceApi->getRoomBuildingList($this->params);
if ($result['status'] == 'successful') {
......@@ -72,6 +74,7 @@ class OfficeRoom extends Basic
*/
public function filtrateConditionRoom()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
if (empty($params["city"])) {
return $this->response("101", "参数错误");
......
<?php
namespace app\api_broker\controller;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-09-02
* Time: 15:27:57
*/
use app\api_broker\extend\Basic;
use app\api_broker\service\VipService;
use app\index\service\AmercementService;
use app\model\USpreadUser;
use think\Request;
class Amercement extends Basic
{
protected $s_amercement;
public function __construct($request = null)
{
parent::__construct($request);
$this->s_amercement = new AmercementService();
}
/**
* 新增罚款
* @return \think\Response
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=918
*/
public function addAmercement(){
$params = $this->params;
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
$checkResult = $this->validate($params, "AmercementValidate.addAmercement");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$vip = new VipService();//0:有权限 1:无权限
$is_can_edit = $vip->checkRule($this->agentId, 'addAmercement');
if($is_can_edit == 1){
return $this->response("101", "暂无权限");
}
$father_id = $this->s_amercement->addAmercement($params,$this->agentId);//int(1)
if ($father_id) {
if (isset($params['img']) && !empty($params['img'])) {
$this->s_amercement->addAmercementImg($params['img'], $father_id);
}
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
}
}
/**
* 获取类型
* @return \think\Response
*/
public function getAmercementType(){
$res = $this->s_amercement->getAmercementType();
return $this->response("200", "成功",$res);
}
/**
* 罚款账单
* @return \think\Response
*/
public function getAmercementList(){
$params = $this->params;
// $params = array(
// "agent_id" => 5776,
// "status" => 0,
// "amercement_type" => 0,
// );
$checkResult = $this->validate($params, "AmercementValidate.getAmercementList");
if (true !== $checkResult) {
return $this->response("300", $checkResult);
}
$page_no = empty($params["page_no"]) ? 1 : $params["page_no"];
$page_size = empty($params["page_size"]) ? 15 : $params["page_size"];
$status = $params['status'];
$amercement_type = $params['amercement_type'];//0我需要支付的 1我提交的
$result = $this->s_amercement->getAmercementList($status,$amercement_type,$params['agent_id'], $page_no, $page_size);//int(1)
return $this->response("200", "成功",$result);
}
}
\ No newline at end of file
......@@ -107,8 +107,12 @@ class DailyPaper extends Basic
$daily_date = $params["daily_date"];
$alipay = $params["alipay"];
$tenpay = $params["tenpay"];
$alipay_1 = $params["alipay"];
$tenpay_1 = $params["tenpay"];
$tenpay_2 = $params["tenpay_2"];
$alipay_2 = $params["alipay_2"];
$tenpay_3 = $params["tenpay_3"];
$alipay_3 = $params["alipay_3"];
$realty_pay = $params["realty_pay"];
$private_bank = $params["private_bank"];
$family_pay = $params["family_pay"];
......@@ -120,9 +124,10 @@ class DailyPaper extends Basic
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
$bank_card_sz = $params["bank_card_sz"] ? $params["bank_card_sz"] : 0;
$result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card, $bank_card_yun
, $bank_card_lin, $bank_card_new);
, $bank_card_lin, $bank_card_new, $bank_card_sz, $tenpay_1, $alipay_1, $tenpay_3, $alipay_3);
if ($result["code"] == 101) {
return $this->response("101", $result["msg"]);
} else {
......@@ -180,5 +185,4 @@ class DailyPaper extends Basic
}
}
\ No newline at end of file
......@@ -159,4 +159,65 @@ class LookShop extends Basic
return $this->response("200", "request success", $result);
}
/**
* 客户浏览记录 商铺详情点进去查看哪些客户看了的
* PC后台调
* @return \think\Response
*/
public function getShopUserVisitLog()
{
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$s_look_Shop = new LookShopService();
$result = $s_look_Shop->getShopUserVisitLog($params,$pageNo, $pageSize);
return $this->response("200", "success", $result);
}
/**
* 客户浏览记录 商铺详情点进去查看哪些客户看了的
* APP调
* @return \think\Response
*/
public function getLookShopList()
{
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getLookShopList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$s_look_Shop = new LookShopService();
$result = $s_look_Shop->getShopUserVisitLog($params,$pageNo, $pageSize);
return $this->response("200", "success", $result);
}
/**
* 我的看铺记录
* @return \think\Response
*/
public function getShopLookList()
{
$params = $this->params;
$checkResult = $this->validate($params, "UserLookShopValidate.getShopLookList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$s_look_Shop = new LookShopService();
$result = $s_look_Shop->getShopLookList($params['user_id'],$pageNo,$pageSize);
return $this->response("200", "success", $result);
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LookShopService;
use app\api_broker\service\OrderLogService;
use app\api_broker\service\VerifyService;
use app\api_broker\service\VipService;
use app\index\service\HouseService;
......@@ -1344,24 +1345,44 @@ class Shop extends Basic
public function getUserLookShopList()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"house_id" => 1,
"pageNo" => 1,
"pageSize" => 15
);*/
$params = $this->params;
/* $params = array(
"house_id" => 1,
"pageNo" => 1,
"pageSize" => 15
);*/
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
if (!isset($params["house_id"])) {
return $this->response("101", "请求参数错误");
}
//t_look_shop_user
$lookShopUserModel = new TLookShopUser();
$where_["house_id"] = $params["house_id"];
$where_["source"] = 0;
$logArr = $lookShopUserModel->getLogList($where_, "id,user_id,type,house_id,create_time as look_day", $pageNo, $pageSize);
return $this->response("200", "success", $logArr);
}
/**
* 商铺详情页带看动态
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getReportListByHouseId()
{
$params = $this->params;
$house_id = $params["house_id"];
if (!$house_id) {
return $this->response("101", "请求参数错误");
}
$orderLogService = new OrderLogService();
$houseArr = $orderLogService->selectReportListByHouseId($house_id);
if (count($houseArr) > 0) {
return $this->response("200", "success", $houseArr);
}
return $this->response("200", "null");
}
}
......@@ -74,10 +74,10 @@ class StoreFee extends Basic
$bank = $params["bank"];
$card_no = $params["card_no"];
$count_time = $params["count_time"];
if (($type == 1 || $type == 5) && !$office_id){
if (($type == 1 || $type == 5) && !$office_id) {
return $this->response("101", "办公室必传");
}
$img_arr = isset($params["img_arr"]) ? json_decode($params["img_arr"], true) : "";
$img_arr = isset($params["img_arr"]) ? json_decode($params["img_arr"], true) : "";
if (!$img_arr) {
return $this->response("101", "请上传图片");
}
......@@ -85,6 +85,10 @@ class StoreFee extends Basic
if (!$if_verify) {
return $this->response("101", "类型选择错误");
}
$is_commit = $this->service_->verifyTypeAndFeeItem($type, $fee_item, $store_id, $office_id, $count_time);
if (!$is_commit) {
return $this->response("101", "办公室水电费每月只能提交一次");
}
$is_ok = $this->service_->addApplyFor($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, 0, $office_id);
if ($is_ok > 0) {
......
......@@ -14,15 +14,18 @@ use think\Log;
*/
class BargainService
{
/**
* 获取成交报告列表
/**获取成交报告列表
* @param $pageNo
* @param $pageSize
* @param $submit_agent_id
* @param $status
* @param $is_my_correlation
* @param $keyword
* @return array|false|\PDOStatement|string|\think\Collection
* @param $bargain_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id)
{
......@@ -32,7 +35,8 @@ class BargainService
$aService = new VerifyService();
$ids = $aService->getAgentsByAgentId($submit_agent_id);
$condition["ids"] = $ids;
$condition["ids"] = $ids;
$condition["submit_agent_id"] = $submit_agent_id;
} else {
$condition["father_id"] = 0;
}
......@@ -51,7 +55,7 @@ class BargainService
$condition["status"] = 21;
break;
case 5://调账->搜成交报告 不包括 待撤销和已撤销
$condition["status"] = array('not in','20,21');
$condition["status"] = array('not in', '20,21');
break;
default:
}
......@@ -74,7 +78,7 @@ class BargainService
return $convertResult;
}
public function getBargainListV2($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id,$type)
public function getBargainListV2($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id, $type)
{
$condition = [];
......@@ -82,7 +86,8 @@ class BargainService
$aService = new VerifyService();
$ids = $aService->getAgentsByAgentId($submit_agent_id);
$condition["ids"] = $ids;
$condition["ids"] = $ids;
$condition["submit_agent_id"] = $submit_agent_id;
} else {
$condition["father_id"] = 0;
}
......@@ -101,7 +106,7 @@ class BargainService
$condition["status"] = 21;
break;
case 5://调账->搜成交报告 不包括 待撤销和已撤销
$condition["status"] = array('not in','20,21');
$condition["status"] = array('not in', '20,21');
break;
default:
}
......
......@@ -199,7 +199,8 @@ class DailyPaperService
$total["private_bank"] = 0;
$total["cash"] = 0;
$total["other_bank"] = 0;
$total["bank_card"] = 0;
$total["bank_card"] = 0; //上海银满谷
$total["bank_card_sz"] = 0; //深圳银满谷
//71 筠姐上海银行卡 72林老师建行卡 73新同联福居银行卡 74陈志杰招商
$total["bank_card_yun"] = 0;
$total["bank_card_lin"] = 0;
......@@ -217,7 +218,7 @@ class DailyPaperService
$total["alipay_2"] += $item["money"];
break;
case 12:
$total["alipay"] += $item["money"];
$total["alipay_1"] += $item["money"];
break;
case 13:
$total["alipay_3"] += $item["money"];
......@@ -229,7 +230,7 @@ class DailyPaperService
$total["tenpay_2"] += $item["money"];
break;
case 22:
$total["tenpay"] += $item["money"];
$total["tenpay_1"] += $item["money"];
break;
case 23:
$total["tenpay_3"] += $item["money"];
......@@ -267,6 +268,9 @@ class DailyPaperService
case 74:
$total["bank_card_chen"] += $item["money"];
break;
case 75:
$total["bank_card_sz"] += $item["money"];
break;
}
}
return $total;
......@@ -614,7 +618,7 @@ class DailyPaperService
*/
public function addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card,
$bank_card_yun, $bank_card_lin, $bank_card_new)
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_sz,$tenpay_1,$alipay_1,$tenpay_3,$alipay_3)
{
$agent_info_arr["agent_id"] = $agent_id;
$agent_info_field = "id,name,store_id,district_id,level";
......@@ -634,7 +638,8 @@ class DailyPaperService
}
$params = $this->dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $agent_info[0]["store_id"], $agent_info[0]["district_id"],
$tenpay_2, $alipay_2, $site_id, $bank_card, $bank_card_yun, $bank_card_lin, $bank_card_new);
$tenpay_2, $alipay_2, $site_id, $bank_card, $bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_sz,
$tenpay_1,$alipay_1,$tenpay_3,$alipay_3);
$is_ok = $this->oDailyModel->addDaily($params);
if ($is_ok > 0) {
//更新财务日报未提交记录表数据
......@@ -648,7 +653,7 @@ class DailyPaperService
public function dailyBin($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay, $family_pay, $private_bank,
$cash, $pos, $other_bank, $store_id, $district_id, $tenpay_2, $alipay_2, $site_id, $bank_card,
$bank_card_yun, $bank_card_lin, $bank_card_new)
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_sz,$tenpay_1,$alipay_1,$tenpay_3,$alipay_3)
{
$arr["agent_id"] = $agent_id;
$arr["agent_name"] = $agent_name;
......@@ -664,12 +669,17 @@ class DailyPaperService
$arr["pos"] = $pos;
$arr["other_bank"] = $other_bank;
$arr["bank_card"] = $bank_card;
$arr["tenpay_1"] = $tenpay_1;
$arr["alipay_1"] = $alipay_1;
$arr["tenpay_2"] = $tenpay_2;
$arr["alipay_2"] = $alipay_2;
$arr["tenpay_3"] = $tenpay_3;
$arr["alipay_3"] = $alipay_3;
$arr["site_id"] = $site_id;
$arr["bank_card_yun"] = $bank_card_yun;
$arr["bank_card_lin"] = $bank_card_lin;
$arr["bank_card_new"] = $bank_card_new;
$arr["bank_card_sz"] = $bank_card_sz;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr;
......@@ -703,7 +713,8 @@ class DailyPaperService
*/
public function addDailyCheck($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay, $family_pay, $private_bank,
$cash, $pos, $other_bank, $remark, $operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_chen, $tenpay_3, $alipay_3)
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_chen, $tenpay_3, $alipay_3,
$tenpay_1, $alipay_1, $bank_card_sz)
{
$agent_info_arr["agent_id"] = $agent_id;
$agent_info_field = "id,name,store_id,district_id,level";
......@@ -720,7 +731,7 @@ class DailyPaperService
}
$params = $this->dailyLogBin($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $remark, $operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_chen, $tenpay_3, $alipay_3);
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_chen, $tenpay_3, $alipay_3, $tenpay_1, $alipay_1, $bank_card_sz);
$is_ok = $this->oDailyLogModel->addDailyCheck($params);
......@@ -764,7 +775,8 @@ class DailyPaperService
*/
public function dailyLogBin($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay, $family_pay, $private_bank,
$cash, $pos, $other_bank, $remark, $operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_chen, $tenpay_3, $alipay_3)
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_chen, $tenpay_3, $alipay_3,
$tenpay_1, $alipay_1, $bank_card_sz)
{
$arr["daily_id"] = $daily_id;
$arr["operation_id"] = $agent_id;
......@@ -779,15 +791,19 @@ class DailyPaperService
$arr["pos"] = $pos;
$arr["other_bank"] = $other_bank;
$arr["operation_status"] = $operation_status;
$arr["tenpay_1"] = $tenpay_1;
$arr["alipay_1"] = $alipay_1;
$arr["tenpay_2"] = $tenpay_2;
$arr["alipay_2"] = $alipay_2;
$arr["alipay_3"] = $alipay_3;
$arr["tenpay_3"] = $tenpay_3;
$arr["bank_card"] = $bank_card;
$arr["bank_card_yun"] = $bank_card_yun;
$arr["bank_card_lin"] = $bank_card_lin;
$arr["bank_card_new"] = $bank_card_new;
$arr["bank_card_new"] = $bank_card_new;
$arr["alipay_3"] = $alipay_3;
$arr["bank_card_chen"] = $bank_card_chen;
$arr["bank_card_sz"] = $bank_card_sz;
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
return $arr;
......
......@@ -7,6 +7,7 @@ use app\model\AAgents;
use app\model\GHousesToAgents;
use app\model\SystemConfig;
use app\model\TLookShopUser;
use app\model\Users;
use RedisException;
use think\Exception;
use think\Log;
......@@ -237,6 +238,61 @@ class LookShopService
/**
* 客户浏览记录
* @param $conditions
* @param $pageNo
* @param $pageSize
* @return bool|false|\PDOStatement|string|\think\Collection
*/
public function getShopUserVisitLog($conditions,$pageNo, $pageSize)
{
$m_look_shop = new TLookShopUser();
$field = 'a.type,a.user_id,a.create_time,a.source,b.buyer_nick,b.buyer_img,c.id';
$conditions_['a.house_id'] = $conditions['house_id'];
$list = $m_look_shop->getLookShopList($conditions_, $field, $pageNo, $pageSize);
if (!$list) {
return [];
}
$u_user = new Users();
foreach ($list as $k => $v) {
if($v['source'] == 0){
$fields = "b.buyer_nick,b.buyer_img";
$result = $u_user->getUserInfoById(['user_id'=>$v['user_id']], $fields);
$list[$k]['buyer_nick'] = $result['buyer_nick'];
$list[$k]['buyer_img'] = $result['buyer_img'];
}else{
$list[$k]['user_id'] = $v['id'];
}
unset($list[$k]['id']);
}
return $list;
}
/**
* 我的看铺记录
* @param $user_id
* @param $pageNo
* @param $pageSize
* @return bool|false|\PDOStatement|string|\think\Collection
*/
public function getShopLookList($user_id,$pageNo,$pageSize)
{
$m_user = new Users();
$fields = "b.id,b.buyer_nick";
$result = $m_user->getUserInfoById(['user_id'=>$user_id], $fields);
if (isset($result[0]["id"]) && $result[0]["id"] > 0) {
$conditions[] = ['EXP', "(a.user_id = {$result[0]["id"]} and a.source = 1) or (a.user_id = {$user_id} and a.source = 0)"];
}else{
$conditions['a.user_id'] = $user_id;
}
$field = 'a.type,a.create_time,a.house_id';
$m_look_shop = new TLookShopUser();
$list = $m_look_shop->getLookShopList($conditions, $field, $pageNo, $pageSize);
return $list;
}
......
......@@ -140,9 +140,28 @@ class MyCenterService{
$bank_data = $this->getBank($result['id']);
$result = array_merge($result, $bank_data);
//是否有权限新增罚款 0:有权限 1:无权限
$result['is_can_add_amercement'] =$this->isCanAddAmercement($agent_id);
return $result;
}
/**
* 权限查看
* @param $agent_id
* @return int
*/
public function isCanAddAmercement($agent_id){
$is_can_add_amercement = 1;
$vip = new VipService();//0:有权限 1:无权限
$res = $vip->checkRule($agent_id, 'addAmercement');
if($res == 0){
$is_can_add_amercement = 0;
}
return $is_can_add_amercement;
}
public function getBank($agent_id)
{
$m_bank = new AAgentsBank();
......
......@@ -11,6 +11,7 @@ namespace app\api_broker\service;
use app\api\service\PushClientService;
use app\api\untils\GeTuiUtils;
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\ABindingDevice;
use app\model\AStore;
......@@ -162,7 +163,7 @@ class PushMessageService
$report = new OReportModel();
$feed = new PushFeed();
$agent = new AAgents();
// $agent = new AAgents();
$field = 'house_id,house_title,report_agent_name,user_id,report_agent_id';
$report_data = $report->getReportOrder($field, [ 'a.id' => $report_id ]);
......@@ -174,9 +175,13 @@ class PushMessageService
}
//查询经纪人门店和部门信息
$agent_store = $agent->verifyUser('store_id', '', [ 'id' => $report_data['report_agent_id'] ]);
$store = new AStore();
$store_name = $store->getStoreDistrictName($agent_store['store_id']);
// $agent_store = $agent->verifyUser('store_id', '', [ 'id' => $report_data['report_agent_id'] ]);
// $store = new AStore();
// $store_name = $store->getStoreDistrictName($agent_store['store_id']);
$s_service = new RedisCacheService();
$agent_data = $s_service->getRedisCache(2, $report_data['report_agent_id']);
$content = $agent_data['store_name'].'-'.$agent_data['name'];
$title = '成交就是这么简单';
$feed->editData([
......@@ -184,7 +189,7 @@ class PushMessageService
'agent_id' => -1,
'report_id' => $report_id,
'house_id' => $report_data['house_id'],
'content' => $store_name . $report_data['report_agent_name'],
'content' => $content,
'steel_phone' => 0,
'type' => 0,
'status' => 0,
......@@ -282,18 +287,24 @@ class PushMessageService
return false;
}
$m_agent_device = new ABindingDevice();
$device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id, 'is_forbidden' => $is_forbidden, 'is_pc'=>0 ], 'id,push_id');
$result = [];
if (!empty($device_id_array)) {
foreach ($device_id_array as $k => $v) {
if (!empty($v['push_id'])) {
$house_id = empty($house_id) ? '':$house_id;
$result[] = $this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id, $house_id, $order_id, $title);
$key = 'agent_push_id_'.$id;
$redis = RedisExt::getRedis();
$push_id = $redis->get($key);
if (empty($push_id)) {
$m_agent_device = new ABindingDevice();
$device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id, 'is_forbidden' => $is_forbidden, 'is_pc'=>0 ], 'id,push_id');
$result = [];
if (!empty($device_id_array)) {
foreach ($device_id_array as $k => $v) {
if (!empty($v['push_id'])) {
$house_id = empty($house_id) ? '':$house_id;
$result[] = $this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id, $house_id, $order_id, $title);
}
}
}
} else {
$result[] = $this->push->public_push_message_for_one($id, $push_id, $title, $content, $type, $user_id, $house_id, $order_id, $title);
}
return $result;
}
......@@ -447,6 +458,14 @@ class PushMessageService
$title = '退款成功';
$type = '';
break;
case 17:
$title = '意向金转定提醒';
$type = 'house_transfer_time';
break;
case 18:
$title = '意向金转定提醒';
$type = 'office_transfer_time';
break;
}
$this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], $type, $id, $is_forbidden,$v['house_id'], $v['order_id']);
......@@ -625,7 +644,16 @@ class PushMessageService
$push_data = $m_push->getDateLimit($field, $where, 100);
foreach ($push_data['data'] as $k => $v) {
$this->pushAgentAllDeviceId($v['addressee_id'], $v['title'], $v['message'], $v['type'], $id, $is_forbidden, $v['house_id'], $v['order_id']);
$title = $v['title'];
switch ($v['type']) {
case 8 :
$id = $v['order_id'];
$type = 'punishment'; //新增 处罚
break;
default :
$type = $v['type'];
}
$this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], $type, $id, $is_forbidden, $v['house_id'], $v['order_id']);
$id_array[] = $v['id'];
}
if (isset($id_array)) {
......@@ -634,4 +662,42 @@ class PushMessageService
$m_push->updateData($update_data, ['id' => ['in', $id_array]]);
}
}
/**
* 新增处罚 推送
*
* @param $agent_id
* @param $id
* @param $operation_id
* @return bool
*/
public function pushAmercementMessage($agent_id, $id, $operation_id)
{
if (empty($agent_id)) {
return false;
}
$agent_id_arr[] = $agent_id;
$record_data['message'] = '您有一笔罚款需要支付,罚款编号:'.$id;
$record_data['title'] = '新增处罚';
// $s_redis = new RedisCacheService();
// $agent_data = $s_redis->getRedisCache(2, $agent_id);
// if (!empty($agent_data)) {
// $m_agent = new AAgents();
// $where['store_id'] = $agent_data['store_id'];
// $where['level'] = ['in', '20,40'];
// $where['id'] = ['<>', $agent_id];
// $where['status'] = 0;
// $store_agent_id = $m_agent->getFieldOneValue('id', $where);
//
// if ($store_agent_id) {
// $agent_id_arr[] = $store_agent_id;
// }
// }
$this->recordCheck(8, $agent_id_arr, $operation_id, $record_data);
return true;
}
}
\ No newline at end of file
......@@ -46,7 +46,8 @@ class StoreFeeService
* @param int $id
* @param int $office_id
* @return int|string
* @throws \app\model\Exception
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function addApplyFor($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0)
......@@ -66,9 +67,7 @@ class StoreFeeService
return $feeId;
}
/**
* 后台提交无需总监审核
*
/**后台提交无需总监审核
* @param $type
* @param $fee_item
* @param $total_fee
......@@ -85,7 +84,8 @@ class StoreFeeService
* @param int $office_id
* @param int $status
* @return int|string
* @throws \app\model\Exception
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id = 0, $office_id = 0, $status = 0)
......@@ -105,10 +105,46 @@ class StoreFeeService
return $feeId;
}
//费用类型 1办公室成本 2上海总部成本 3分部成本 4同联发展基金 5门店单独成本
public function verifyType($type, $fee_item)
/**
* @param $type
* @param $fee_item
* @param $store_id
* @param $office_id
* @param $count_time
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function verifyTypeAndFeeItem($type, $fee_item, $store_id, $office_id, $count_time)
{
if ($type == 1 && $fee_item == 101) {
if ($office_id <= 0) {
$storeModel = new AStore();
$field = "id,office_id";
$office_info = $storeModel->findStore($field, ["id" => $store_id]);
$office_id = $office_info["office_id"];
}
if (!$count_time) {
$count_time = date("Y-m-01", time());
}
$applyForArr = $this->applyForFeeModel->findByOne("id", [
"type" => $type,
"fee_item" => $fee_item,
"office_id" => $office_id,
"count_time" => $count_time
]
);
if (count($applyForArr) > 0) {
return false;
}
}
return true;
}
//费用类型 1办公室成本 2上海总部成本 3分部成本 4同联发展基金 5门店单独成本 6不计入成本
public function verifyType($type, $fee_item)
{
switch ($type) {
case 1:
if ($fee_item > 0 && $fee_item < 200) {
......@@ -130,6 +166,11 @@ class StoreFeeService
return true;
}
break;
case 6:
if ($fee_item > 600 && $fee_item < 700) {
return true;
}
break;
}
return false;
}
......@@ -165,9 +206,6 @@ class StoreFeeService
if ($total_fee) {
$arr["total_fee"] = $total_fee;
}
if ($agent_id) {
$arr["agent_id"] = $agent_id;
}
if ($store_id) {
$arr["store_id"] = $store_id;
}
......@@ -202,6 +240,9 @@ class StoreFeeService
}
$arr["update_time"] = date("Y-m-d H:i:s", time());
if ($id <= 0) {
if ($agent_id) {
$arr["agent_id"] = $agent_id; //申请人,防止编辑前端传错误数据。
}
$arr["create_time"] = date("Y-m-d H:i:s", time());
} else {
$arr['id'] = $id;
......
......@@ -113,6 +113,10 @@ class UploadFileService
$path .= 'static/excel/';
$internet_path = '';
break;
case 'amercement_img' :
$path .= 'static/amercement_img/';
$internet_path = '';
break;
default :
$data['code'] = 101;
$data['msg'] = "上传图片类型错误";
......
<?php
namespace app\api_broker\validate;
use think\Validate;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-09-02
* Time: 16:27:00
*/
class AmercementValidate extends Validate{
protected $rule = [
'type' => 'require|number|in:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17',
'money' => 'require|number|gt:0',
'agent_id' => 'require|number|gt:0',
'remarks' => 'require',
'status' => 'require|number|in:0,1,2',
'amercement_type' => 'require|number|in:0,1',
];
protected $message = [
'type.require' => 'type为必填字段',
'type.number' => 'type只能为数字',
'type.in' => 'type范围错误',
'money.require' => 'money为必填字段',
'money.number' => 'money只能为数字',
'money.gt' => 'money必须大于0',
'agent_id.require' => 'agent_id为必填字段',
'agent_id.number' => 'agent_id只能为数字',
'agent_id.gt' => 'agent_id必须大于0',
'remarks.require' => '罚款原因不能为空',
'status.require' => 'status为必填字段',
'status.number' => 'status只能为数字',
'status.in' => 'status范围错误',
'amercement_type.require' => 'amercement_type为必填字段',
'amercement_type.number' => 'amercement_type只能为数字',
'amercement_type.in' => 'amercement_type范围错误',
];
protected $scene = [
'addAmercement' => [ 'type', 'money', 'agent_id', 'remarks'],
'getAmercementList' => [ 'agent_id', 'status', 'amercement_type'],
];
}
<?php
namespace app\api_broker\validate;
use think\Validate;
/**
* Created by PhpStorm.
* User : zhuwei
* Date : 2019-08-29
* Time : 17:47:05
* Intro:
*/
class UserLookShopValidate extends Validate
{
protected $rule = [
'house_id' => 'require|number|gt:0',
'user_id' => 'require|number|gt:0',
];
protected $message = [
'house_id.require' => 'house_id必传字段',
'house_id.number' => 'house_id必须为数字',
'house_id.gt' => 'house_id必须大于0',
'user_id.require' => 'user_id必传字段',
'user_id.number' => 'user_id必须为数字',
'user_id.gt' => 'user_id必须大于0',
];
protected $scene = [
'getLookShopList' => ['house_id'],
'getShopLookList' => ['user_id'],
];
}
\ No newline at end of file
......@@ -588,7 +588,7 @@ class AppChat extends Basic
//获取此经纪人的所有盘方楼盘id
$param["addressee_id"] = $params["agent_id"];
$param["type"] = ['in', '8'];
$param["type"] = ['in', '8,17,18'];
$msgModel = new MPushMessage();
$history_result = $msgModel->getListByWhere($field, $param, $page_no, $page_size);
......@@ -687,7 +687,7 @@ class AppChat extends Basic
$data["user_count"] = $msgModel->getListCountByWhere($param);
$param["type"] = array("in", "1,3");
$data["shop_count"] = $msgModel->getListCountByWhere($param);
$param["type"] = 8;
$param["type"] = ['in', '8,16,17'];
$data["report_count"] = $msgModel->getListCountByWhere($param);
$param["type"] = array("in", "10,11");
$data["square_count"] = $msgModel->getListCountByWhere($param);
......@@ -742,12 +742,19 @@ class AppChat extends Basic
$param["is_read"] = 0;
//TODO 获取未读个数
$msgModel = new MPushMessage();
$param["type"] = array("in", "1,2,3,8,10,11");
$param["type"] = array("in", "1,2,3,8,10,11,17,18");
$shop_count = $msgModel->getListCountByWhere($param);
if ($shop_count > 0) {
return $this->response("200", "success", ["is_show_red" => true]);
} else {
$msgCheckModel = new MPushCheckMessage();
// $param["type"] = array("in", "8");
unset($param['type']);
$check_count = $msgCheckModel->getListCountByWhere($param);
if ($check_count > 0) {
return $this->response("200", "success", ["is_show_red" => true]);
}
}
$where["to_id"] = "agent_" . $params["agent_id"];
}else{
$where["to_id"] = "user_" . $params["user_id"];
......
......@@ -13,6 +13,7 @@ namespace app\chat\service;
use app\api_broker\service\RedisCacheService;
use app\chat\utils\RegisterUtil;
use app\chat\utils\RPush;
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\ChatMsg;
use app\model\ChatMsgExt;
......@@ -89,6 +90,11 @@ class ChatService
if ($id > 0 && $device_id && $push_id) {
$this->savePushIdV3($id, $device_id, $push_id, $source);
}
if ($source == 1) {
$this->currentDevice($user_id, $push_id); //经纪人当前登陆设备
}
return ["code" => 200, "only_id" => $only_id];
}
......@@ -714,5 +720,24 @@ class ChatService
return $this->chatUserModel->addChatUser($params);
}
/**
* 记录当前设备
*
* @param $agent_id
* @param $push_id
* @return bool
*/
public function currentDevice($agent_id, $push_id)
{
if (empty($agent_id) || empty($push_id)) {
return false;
}
$key = 'agent_push_id_'.$agent_id;
$redis = RedisExt::getRedis();
$push_old = $redis->get($key);
if ($push_old != $push_id) {
$redis->set($key, $push_id, 2592000); //30天有效期
}
return true;
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-09-02
* Time: 16:17:32
*/
namespace app\index\controller;
use app\api_broker\service\VipService;
use app\index\extend\Basic;
use app\index\service\AmercementService;
class Amercement extends Basic
{
private $s_amercement;
public function __construct()
{
parent::__construct();
$this->s_amercement = new AmercementService();
}
/**
* 新增罚款
* @return \think\Response
* http://showdoc.tonglianjituan.com/index.php?s=/1&page_id=918
*/
public function addAmercement(){
$params = $this->params;
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '罚你不需要理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
$checkResult = $this->validate($params, "AmercementValidate.addAmercement");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$vip = new VipService();//0:有权限 1:无权限
$is_can_edit = $vip->checkRule($this->userId, 'addAmercement');
if($is_can_edit == 1){
return $this->response("101", "暂无权限");
}
$father_id = $this->s_amercement->addAmercement($params,$this->userId);//int(1)
if ($father_id) {
if (isset($params['img']) && !empty($params['img'])) {
$this->s_amercement->addAmercementImg($params['img'], $father_id);
}
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
}
}
/**
* 后台罚款账单表
* @return \think\Response
*/
public function getAmercementListPc(){
$params = $this->params;
// $params = array(
// "agent_id" => 5776,
// "status" => 0,
// "amercement_type" => 0,
// );
$page_no = empty($params["page_no"]) ? 1 : $params["page_no"];
$page_size = empty($params["page_size"]) ? 15 : $params["page_size"];
$result = $this->s_amercement->getAmercementListPc($params,$page_no, $page_size);//int(1)
if ($result) {
return $this->response("200", "成功",$result);
} else {
return $this->response("101", "失败");
}
}
/**
* 导出excel
* @return \think\Response
*/
public function getAmercementListExcel(){
$params = $this->params;
$result = $this->s_amercement->getAmercementListExcel($params);//int(1)
if ($result) {
return $this->response("200", "成功",$result);
} else {
return $this->response("101", "失败");
}
}
/**
* 详情
* @return \think\Response
*/
public function getAmercementInfo(){
$params = $this->params;
// $params = array(
// "id" => 1,
// );
$checkResult = $this->validate($params, "AmercementValidate.getAmercementInfo");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$result = $this->s_amercement->getAmercementInfo($params['id']);//int(1)
if ($result) {
return $this->response("200", "成功",$result);
} else {
return $this->response("101", "失败");
}
}
/**
* 编辑
* @return \think\Response
*/
public function editAmercement(){
$params = $this->params;
// $params = array(
// "id" => 1,
// "edit_type" => 0,//0编辑 1取消 2转已支付
// );
$checkResult = $this->validate($params, "AmercementValidate.editAmercement");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$res = $this->s_amercement->editAmercement($params['id'],$params,$params['edit_type'],$this->userId);//int(1)
return $this->response($res['code'], $res['msg']);
}
/**
* 删除图片
* @return \think\Response
*/
public function delAmercementImage(){
$params = $this->params;
$checkResult = $this->validate($params, "AmercementValidate.delAmercementImage");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$res = $this->s_amercement->delAmercementImage($params['id']);//int(1)
return $this->response("200", "成功",['data'=>$res]);
}
}
\ No newline at end of file
......@@ -288,10 +288,18 @@ class Broker extends Basic
* @throws \think\exception\DbException
*/
public function getAgentDistrictStore() {
$m_store = new AAgents();
$where['a.id'] = $this->params['id'];
$field = 'b.store_name, c.district_name';
$data = $m_store->getStoreDistrict($field, $where);
// $m_store = new AAgents();
// $where['a.id'] = $this->params['id'];
// $field = 'b.store_name, c.district_name';
// $data = $m_store->getStoreDistrict($field, $where);
if (empty($this->params['id'])) {
return $this->response(101, '参数错误');
}
$s_redis = new RedisCacheService();
$agent_data = $s_redis->getRedisCache(2, $this->params['id']);
$data['store_name'] = $agent_data['store_name'];
$data['district_name'] = $agent_data['district_name'];
return $this->response(200, '', $data);
}
......
......@@ -95,6 +95,29 @@ class CellPhone extends Basic
$where['a.id'] = $this->params['id'];
}
if (!empty($this->params['shop_house_id'])) {
$m_house = new GLandlordPhone();
$landlord_phone = $m_house->getColumn('phone', ['house_id'=>$this->params['shop_house_id'], 'status'=>0]);
if ($landlord_phone) {
$where['a.peer_no'] = ['in', $landlord_phone];
$where['a.user_type'] = 1;
} else {
return $this->response(200, '');
}
}
if (!empty($this->params['office_house_id'])) {
$m_house = new OfficeGLandlordPhone();
$landlord_phone = $m_house->getColumn('phone', ['house_id'=>$this->params['shop_house_id'], 'status'=>0]);
if ($landlord_phone) {
$where['a.peer_no'] = ['in', $landlord_phone];
$where['a.user_type'] = 2;
} else {
return $this->response(200, '');
}
}
$list = $report->getCallList($pageNo, $pageSize, '', $field, $where);
$m_user = new Users();
// $m_phone_follow = new UPhoneFollowUp($this->siteId);
......
......@@ -41,15 +41,25 @@ class Cost extends Basic
$field = 'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,a.status,';
$field .= 'b.name as agent_name,a.site_id';
$fee_model = new FApplyForFee();
$cost_service = new CostService();
if (empty($this->params['excel'])) {
$list = $fee_model->getJoinAgentList($pageNo, $pageSize, 'a.ID DESC', $field, $where);
$data['list'] = &$list;
if (in_array($this->params['check_status'], [1,2,3,4])) {
$order = 'a.update_time DESC';
} else {
$order = 'a.ID DESC';
}
$list = $fee_model->getJoinAgentList($pageNo, $pageSize, $order, $field, $where);
foreach($list as $k=>$v) {
$list[$k]['type_name'] = $cost_service->getFeeType($v['type']);
$list[$k]['fee_item_name'] = $cost_service->getFeeItem($v['fee_item']);
}
$data['list'] = $list;
$data['total'] = $fee_model->getJoinAgentListTotal($where);
return $this->response(200, '', $data);
} else {
$field .= ',a.card_name,a.card_no,a.store_id,a.office_id';
$list = $fee_model->getJoinAgentList(1, 100000, 'a.ID DESC', $field, $where);
$cost_service = new CostService();
$redis = new RedisCacheService();
$source = [
0=> 'app申请',
1=>'excel导入'
......@@ -62,7 +72,31 @@ class Cost extends Basic
4=>'三审通过',
];
$redis = new RedisCacheService();
foreach ($list as $k=>$v) {
switch ($v['type']) {
case 5 :
$store_id[] = $v['store_id'];
break;
default :
$office_id[] = $v['office_id'];
break;
}
}
$store_data = $office_data = [];
if (isset($store_id)) {
$store_id = array_filter($store_id);
$store_id = array_unique($store_id);
$m_store = new AStore();
$store_data = $m_store->getColumn('id,store_name', ['id'=>['in', $store_id]]);
}
if (isset($office_id)) {
$office_id = array_filter($office_id);
$office_id = array_unique($office_id);
$m_office = new FOffice();
$office_data = $m_office->getColumn('id,office_name', ['id'=>['in', $office_id]]);
}
foreach ($list as $k=>$v) {
$type_name = $cost_service->getFeeType($v['type']);
$fee_item_name = $cost_service->getFeeItem($v['fee_item']);
......@@ -71,6 +105,16 @@ class Cost extends Basic
$type_name = $city_name.'-'.$type_name;
}
$store_name = $office_name = '';
switch ($v['type']) {
case 5 :
$store_name = array_key_exists($v['store_id'], $store_data) ? $store_data[$v['store_id']] : '';
break;
default :
$office_name = array_key_exists($v['office_id'], $office_data) ? $office_data[$v['office_id']] : '';
break;
}
$excel_data[$k] = [
'id'=>$v['id'],
'count_time'=>$v['count_time'],
......@@ -81,14 +125,18 @@ class Cost extends Basic
'fee_item_name'=>$fee_item_name,
'purpose'=>$v['purpose'],
'source_name' => $source[$v['source']],
'status'=>$status[$v['status']]
'status'=>$status[$v['status']],
'card_name'=>$v['card_name'],
'card_no'=>$v['card_no'],
'store_name'=>$store_name,
'office_name'=>$office_name
];
}
if (isset($excel_data)) {
$export = new ExportExcelUntil();
$title = [ '费用总ID', '计入月份', '提交时间', '提交人', '费用总金额', '费用类型', '费用项目', '费用用途','来源','状态' ];
$export->exportTable('费用报销审核', $excel_data, 11, '费用报销审核', $title);
$title = [ '费用总ID', '计入月份', '提交时间', '提交人', '费用总金额', '费用类型', '费用项目', '费用用途',
'来源','状态','收款卡户名','收款卡账号','费用承担门店','费用承担办公室' ];
$export->exportTable('费用报销审核', $excel_data, 13, '费用报销审核', $title);
}
}
}
......
......@@ -36,12 +36,12 @@ class DailyPaper extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"store_id" => 730,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2019-06-13"
);
$this->userId = 5775;*/
/* $params = array(
"store_id" => 730,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2019-06-13"
);
$this->userId = 5775;*/
if (!isset($params["store_id"]) || !isset($params["is_store"]) || !isset($params["daily_data"])) {
return $this->response("101", "请求参数错误");
}
......@@ -97,9 +97,13 @@ class DailyPaper extends Basic
$agent_name = $params["agent_name"];
$daily_date = $params["daily_date"];
$alipay = $params["alipay"];
$tenpay = $params["tenpay"];
$alipay_1 = $params["alipay"];
$tenpay_1 = $params["tenpay"];
$tenpay_2 = $params["tenpay_2"];
$alipay_2 = $params["alipay_2"];
$tenpay = $params["tenpay"];
$tenpay_3 = $params["tenpay_3"];
$alipay_3 = $params["alipay_3"];
$realty_pay = $params["realty_pay"];
$private_bank = $params["private_bank"];
$family_pay = $params["family_pay"];
......@@ -110,10 +114,11 @@ class DailyPaper extends Basic
$bank_card_yun = $params["bank_card_yun"] ? $params["bank_card_yun"] : 0;
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
$bank_card_sz = $params["bank_card_sz"] ? $params["bank_card_sz"] : 0;
$site_id = $this->siteId;
$result = $this->service_->addDaily($agent_id, $agent_name, $daily_date, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $tenpay_2, $alipay_2, $site_id, $bank_card, $bank_card_yun
, $bank_card_lin, $bank_card_new);
, $bank_card_lin, $bank_card_new, $bank_card_sz,$tenpay_1,$alipay_1,$tenpay_3,$alipay_3);
if ($result["code"] == 101) {
return $this->response("101", $result["msg"]);
} else {
......@@ -179,6 +184,8 @@ class DailyPaper extends Basic
$other_bank = $params["other_bank"];
$remark = $params["remark"];
$operation_status = $params["operation_status"];
$tenpay_1 = $params["tenpay_1"];
$alipay_1 = $params["alipay_1"];
$tenpay_2 = $params["tenpay_2"];
$alipay_2 = $params["alipay_2"];
$tenpay_3 = $params["tenpay_3"];
......@@ -188,12 +195,13 @@ class DailyPaper extends Basic
$bank_card_lin = $params["bank_card_lin"] ? $params["bank_card_lin"] : 0;
$bank_card_new = $params["bank_card_new"] ? $params["bank_card_new"] : 0;
$bank_card_chen = $params["bank_card_chen"] ? $params["bank_card_chen"] : 0;
$bank_card_sz = $params["bank_card_sz"] ? $params["bank_card_sz"] : 0;
if ($operation_status != 0 && $operation_status != 1) {
return $this->response("101", "审核状态错误");
}
$result = $this->service_->addDailyCheck($daily_id, $agent_id, $agent_name, $alipay, $tenpay, $realty_pay,
$family_pay, $private_bank, $cash, $pos, $other_bank, $remark, $operation_status, $tenpay_2, $alipay_2, $bank_card,
$bank_card_yun, $bank_card_lin, $bank_card_new,$bank_card_chen, $tenpay_3, $alipay_3);
$bank_card_yun, $bank_card_lin, $bank_card_new, $bank_card_chen, $tenpay_3, $alipay_3,$tenpay_1, $alipay_1,$bank_card_sz);
if ($result["code"] == 101) {
return $this->response("101", $result["msg"]);
} else {
......@@ -300,4 +308,31 @@ class DailyPaper extends Basic
return $this->response("200", "success", ['img_url' => $img_url]);
}
/**
* 转到审核中
*
* @return \think\Response
*/
public function backDailyCheck()
{
if (empty($this->params["daily_id"])) {
return $this->response("101", "参数错误");
}
$m_daily = new ODaily();
$daily_id = $m_daily->getFieldValue('id', ['id' => $this->params['daily_id'], 'status' => 1]);
if (empty($daily_id)) {
return $this->response("101", "没有该数据");
}
$num = $m_daily->updateDaily(['id' => $daily_id], ['status' => 0]);
if ($num > 0) {
$code = 200;
$msg = '转到审核中成功';
} else {
$code = 101;
$msg = '转到审核中失败';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -14,6 +14,7 @@ use app\model\AAgents;
use app\model\GOperatingRecords;
use app\model\OfficePhoneFollowUp;
use app\model\OfficeUPhoneFollowUp;
use app\model\TLookAgentUserModel;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary;
use app\model\UserAgentModel;
......@@ -722,4 +723,53 @@ class Member extends Basic{
return $this->response("200", "成功",['data'=>$res,'total'=>$res_total]);
}
/**
* 客户查看日志
*
* @return \think\response\View
*/
public function lookUserLog()
{
if (!$this->request->isAjax()) {
return view('look_user_log');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where = [];
if (!empty($this->params['user_id'])) {
$where['user_id'] = $this->params['user_id'];
}
if (!empty($this->params['agent_id'])) {
$where['agent_id'] = $this->params['agent_id'];
}
if (!empty($this->params['create_time_start'])) {
$where['create_time'] = ['>', $this->params['create_time_start']];
}
if (!empty($this->params['create_time_end'])) {
$where['create_time'] = ['<', $this->params['create_time_end']];
}
if (!empty($this->params['create_time_start']) && !empty($this->params['create_time_end'])) {
$where['create_time'] =
['between', [$this->params['create_time_start']. ' 00:00:00', $this->params['create_time_end']. ' 23:59:59']];
}
$m_look = new TLookAgentUserModel();
$list = $m_look->getList($pageNo, $pageSize, 'id desc', 'create_time,user_id,agent_id', $where);
$total = $m_look->getTotal($where);
$s_redis = new RedisCacheService();
foreach($list as $k => $v) {
$agent_data = $s_redis->getRedisCache(2, $v['agent_id']);
$list[$k]['agent_name'] = $agent_data['name'].'-'.$agent_data['phone'];
}
return $this->response(200, '', ['list'=>$list, 'total'=>$total]);
}
}
......@@ -78,7 +78,7 @@ class OfficeBargain extends Basic
$check_status = $this->params['check_status'];
$fields = 'a.id,a.create_time,a.trade_type,f.title,
f.address,a.commission,a.practical_fee,a.scale_fee,a.order_no,
a.order_id,content,a.house_number,a.is_open,a.agent_id,a.submit_agent_name,
a.order_id,content,a.house_number,a.is_open,a.agent_id,a.submit_agent_name,a.backout_time,
a.price,a.audit_level,e.id as partial_commission_id,b.user_phone,b.user_name,a.report_id';
$where['a.father_id'] = 0;
......@@ -288,6 +288,7 @@ class OfficeBargain extends Basic
foreach ($list_data as $k=>$v) {
$list_data[$k]['income_money'] = $m_real->sumField('money',['bargain_id'=>$v['id'], 'is_del'=>0]);
$list_data[$k]['user_phone'] = substr_replace($list_data[$k]['user_phone'], '****', 3, 4);
$list_data[$k]['backout_time'] = empty($v['backout_time'])? '':$v['backout_time'];
}
$data['data']['list'] = $list_data;
......@@ -1411,9 +1412,13 @@ class OfficeBargain extends Basic
return $this->response(101, '收款存在调整,不能撤销!');
}
$params['content'] = trim($this->params['content']); //撤销原因
$m_financial = new OfficeOFinancialAudit();
$result = $m_financial->backOutUpdate($this->params['bargain_id'], $params);
$update_data['status'] = 20;
$update_data['audit_level'] = 0;
$update_data['content'] = trim($this->params['content']); //撤销原因
$update_data['backout_time'] = date('Y-m-d H:i:s');
$where[] = ['EXP', 'id='.$this->params['bargain_id'].' or father_id='.$this->params['bargain_id']];
$where['status'] = ['in', '10,11,12,13'];
$result = $this->m_bargain->updateBargainByWhere($update_data, $where);
if ($result) {
$check = $this->updatePerformanceAll($this->params['bargain_id']);
......@@ -1435,6 +1440,7 @@ class OfficeBargain extends Basic
$financial_data['audit_level'] = 0;
$financial_data['remark'] = empty($this->params['content']) ? "" : $this->params['content'];
$financial_data['audit_id'] = $this->userId;
$m_financial = new OfficeOFinancialAudit();
$m_financial->addAudit($financial_data);
$msg = '撤销成功';
} else {
......
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/9/2
* Time: 10:09
*/
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\OfficeORefundModel;
class OfficeRefund extends Basic
{
/**
* 已审核退款-转审核状态
*
* @return \think\Response
*/
public function recoverCheckRefund()
{
if (empty($this->params['refund_id'])) {
return $this->response(101, '参数错误');
}
$m_refund = new OfficeORefundModel();
$where['id'] = $this->params['refund_id'];
$where['status'] = 2;
$refund_id = $m_refund->getFieldOneValue('id', $where);
if (empty($refund_id)) {
return $this->response(101, '没有该记录');
}
$num = $m_refund->updateRefund(['id' => $refund_id, 'status' => 3]);
if ($num > 0) {
$code = 200;
$msg = '修改成功';
} else {
$code = 101;
$msg = '修改失败';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -109,5 +109,26 @@ class RealTimePerformance extends Basic
return view('finance/forgetSubmitFinancial');
}
}
//意向金未转定列表
public function noRansferEarnest()
{
if (!$this->request->isAjax()) {
return view('finance/noRansferEarnest');
}
}
//删除收款列表
public function delFinanceReport()
{
if (!$this->request->isAjax()) {
return view('finance/delFinanceReport');
}
}
//罚款列表
public function fineMoney()
{
if (!$this->request->isAjax()) {
return view('finance/fineMoney');
}
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/9/2
* Time: 10:09
*/
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\ORefundModel;
class Refund extends Basic
{
/**
* 已审核退款-转审核状态
*
* @return \think\Response
*/
public function recoverCheckRefund()
{
if (empty($this->params['refund_id'])) {
return $this->response(101, '参数错误');
}
$m_refund = new ORefundModel();
$where['id'] = $this->params['refund_id'];
$where['status'] = 2;
$refund_id = $m_refund->getFieldOneValue('id', $where);
if (empty($refund_id)) {
return $this->response(101, '没有该记录');
}
$num = $m_refund->updateRefund(['id' => $refund_id, 'status' => 3]);
if ($num > 0) {
$code = 200;
$msg = '修改成功';
} else {
$code = 101;
$msg = '修改失败';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
......@@ -494,6 +494,10 @@ class StoreFee extends Basic
return $this->response("101", "类型选择错误");
}
}
$is_commit = $service_->verifyTypeAndFeeItem($type, $fee_item,$store_id,$office_id,$count_time);
if(!$is_commit){
return $this->response("101", "办公室水电费每月只能提交一次");
}
$is_ok = $service_->addApplyForPC($type, $fee_item, $total_fee, $agent_id, $store_id, $purpose, $site_id, $card_name,
$bank, $card_no, $count_time, $img_arr, $id, $office_id, $status);
if ($is_ok > 0) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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