Merge pull request 'preview' (#171) from preview into master

Reviewed-on: #171
This commit is contained in:
mkm 2023-11-17 19:05:23 +08:00
commit 2515fcc436
8 changed files with 53 additions and 8 deletions

View File

@ -394,7 +394,7 @@ class CompanyController extends BaseAdminController
} else {
// 根据street码查询所属镇农科公司
$company_select=Db::query("select * from la_company where company_type=:company_type and FIND_IN_SET(:street,responsible_area)", ['company_type' => 41,'street'=>$params['street']], true);
if(empty($company)) {
if(empty($company_select)) {
throw new Exception('当前区域无镇农科公司');
}
$company=$company_select[0];

View File

@ -107,4 +107,10 @@ class DictDataController extends BaseAdminController
return $this->data($result);
}
public function getShareholderMoneyTaskApproveTypeList()
{
$result = DictDataLogic::getShareholderMoneyTaskApproveTypeList();
return $this->data($result);
}
}

View File

@ -99,11 +99,13 @@ class RechargeLogic extends BaseLogic
]);
// 更新用户余额及累计充值金额
User::where(['id' => $order['user_id']])
->dec('total_recharge_amount', $order['order_amount'])
->dec('user_money', $order['order_amount'])
->update();
$userInfo = User::where(['id' => $order['user_id']])->findOrEmpty();
if ($userInfo['total_recharge_amount'] >= $order['order_amount']) {
User::where(['id' => $order['user_id']])
->dec('total_recharge_amount', $order['order_amount'])
->dec('user_money', $order['order_amount'])
->update();
}
// 记录日志
AccountLogLogic::add(
$order['user_id'],

View File

@ -89,4 +89,9 @@ class DictDataLogic extends BaseLogic
{
return DictData::where(['type_value' => 'task_approve_type', 'status' => 1])->column('value');
}
public static function getShareholderMoneyTaskApproveTypeList()
{
return DictData::where(['type_value' => 'shareholder_money_task_approve_type', 'status' => 1])->column('value');
}
}

View File

@ -69,6 +69,8 @@ class TaskController extends BaseApiController
if (isset($param['status']) && $param['status'] > 0) {
$where[] = ['status', '=', $param['status']];
}
$serviceGroupTaskTypeList = DictData::where(['type_value' => 'task_type', 'status' => 1])->column('value', 'id');
$villageTaskTypeList = DictData::where(['type_value' => 'village_task_type', 'status' => 1])->column('value', 'id');
$townTaskTypeList = DictData::where(['type_value' => 'town_task_type', 'status' => 1])->column('value', 'id');
$townMarketingManagerTaskTypeList = DictData::where(['type_value' => 'town_task_type_marketing_director', 'status' => 1])->column('value', 'id');
@ -78,6 +80,19 @@ class TaskController extends BaseApiController
->order(['id' => 'desc', 'status' => 'asc'])
->select()->toArray();
foreach ($res as $k => $item) {
if (isset($serviceGroupTaskTypeList[$item['type']])) {
$res[$k]['task_type_value'] = $serviceGroupTaskTypeList[$item['type']];
}
if (isset($villageTaskTypeList[$item['type']])) {
$res[$k]['task_type_value'] = $villageTaskTypeList[$item['type']];
}
if (isset($townTaskTypeList[$item['type']])) {
$res[$k]['task_type_value'] = $townTaskTypeList[$item['type']];
}
if (isset($townMarketingManagerTaskTypeList[$item['type']])) {
$res[$k]['task_type_value'] = $townMarketingManagerTaskTypeList[$item['type']];
}
if ($item['type'] == 33) {
$company = Company::where('id', $item['company_id'])->field('id,deposit,company_money,user_id,day_count,company_type,province,city,area,street,village,brigade,responsible_area')->find(); // 可能要判断预存金是否满足
$find = App(RemoteController::class)->shang_date_total_price($company,$param,$item['template_id']);

View File

@ -76,7 +76,7 @@ class UserLogic extends BaseLogic
public static function info(int $userId)
{
$user = User::where(['id' => $userId])->with(['company'])
->field('id,sn,sex,is_new_user,account,nickname,real_name,avatar,mobile,create_time,user_money,deposit,income,admin_id,company_id,is_captain,province,province province_name,city,city city_name,area,area area_name,street,street street_name,village,village village_name,brigade,brigade brigade_name')
->field('id,sn,sex,is_new_user,account,nickname,real_name,avatar,mobile,create_time,user_money,deposit,income,admin_id,company_id,is_captain,province,province province_name,city,city city_name,area,area area_name,street,street street_name,village,village village_name,brigade,brigade brigade_name, group_id')
->findOrEmpty();
// $user['avatar'] = $user['avatar'] ? Request()->host() . $user['avatar'] : $user['avatar'];
$user['day_money_count']=UserAccountLog::where(['user_id'=>$userId,'action'=>1])->whereDay('create_time')->sum('change_amount');

View File

@ -32,7 +32,7 @@
$params=$this->request->post(['page_no','page_size','company_name','area_name','street_name','area_manager','company_type','is_contract']);
$where = [];
if(!empty($params['company_name'])){
$where[] = ['company','like','%'.$params['company_name'].'%'];
$where[] = ['company_name','like','%'.$params['company_name'].'%'];
}
if(!empty($params['area_name'])){
$arr= Db::name('geo_area')->where('area_name','like','%'.$params['area_name'].'%')->column('area_code');
@ -415,4 +415,20 @@
}
}
public function getPartyA()
{
if(!$this->request->isPost()){
return $this->fail('请求方式错误');
}
$companyId = $this->request->param('company_id');
if(empty($companyId)){
return $this->fail('缺少公司id');
}
$re = CompanyLogic::getPartyA($companyId);
if ($re === false) {
return $this->fail(CompanyLogic::getError());
}
return $this->success('成功', $re);
}
}

View File

@ -5,6 +5,7 @@ namespace app\middleapi\controller;
use app\adminapi\logic\finance\RefundLogic;
use app\common\model\refund\RefundRecord;
use app\common\controller\BaseLikeAdminController;
use app\common\service\FileService;
/**
* 退款控制器