更新
This commit is contained in:
parent
df5cdfca24
commit
7977019af0
@ -21,13 +21,24 @@ class CeshiController extends BaseApiController
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
// $all=TaskSchedulingPlan::whereDay('end_time','yesterday')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray();
|
$user_ids = User::where('company_id', $datas['company_id'])->where('is_captain', 1)->field('id,nickname,brigade')->select();
|
||||||
// halt($all);
|
$director_uid = Task::where('id', $datas['task_id'])->value('director_uid');
|
||||||
$all=TaskSchedulingPlan::whereDay('end_time')->where('is_pay',0)->with(['template_info','scheduling'])->select()->toArray();
|
$shareholder_user = User::where('id', $director_uid)->field('id,nickname,brigade')->find();
|
||||||
foreach($all as $k=>$v){
|
$money=bcdiv($data['money'],count($user_ids),2);
|
||||||
queue(TaskInformationJob::class,$v);
|
foreach ($user_ids as $kkk => $vvv) {
|
||||||
|
$company_log = [
|
||||||
|
'sn' => generate_sn(UserAccountLog::class, 'sn', 20),
|
||||||
|
'company_id'=>$datas['company_id'],
|
||||||
|
'change_object' => CompanyAccountLog::SHAREHOLDER,//变动对象
|
||||||
|
'change_type' => CompanyAccountLog::TASK_INC_SHAREHOLDER_MONEY,//变动类型
|
||||||
|
'action' => CompanyAccountLog::INC,//1-增加 2-减少
|
||||||
|
'left_amount' =>bcadd($company['shareholder_money'],$money,2),//变动后数量
|
||||||
|
'change_amount' => $money,//变动数量
|
||||||
|
'remark' =>$shareholder_user['nickname'].'完成了'.$vvv['brigade'].'队的股金:',
|
||||||
|
'status'=>1,
|
||||||
|
];
|
||||||
|
CompanyAccountLog::create($company_log);
|
||||||
}
|
}
|
||||||
halt(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -195,9 +195,12 @@ class CompanyController extends BaseApiController
|
|||||||
// $params = $this->request->param();
|
// $params = $this->request->param();
|
||||||
$find=Company::where('id',$this->userInfo['company_id'])->field('is_contract,shareholder_money')->find()->toArray();
|
$find=Company::where('id',$this->userInfo['company_id'])->field('is_contract,shareholder_money')->find()->toArray();
|
||||||
if($find &&$find['is_contract']==1){
|
if($find &&$find['is_contract']==1){
|
||||||
$find['contract_url']=Contract::where('party_b',$this->userInfo['company_id'])->value('contract_url');
|
$contract=Contract::where('party_b',$this->userInfo['company_id'])->field('contract_url,create_time')->find();
|
||||||
|
$find['contract_url']='https://worker-task.lihaink.cn/uploads/contract/'.$contract['contract_url'];
|
||||||
|
$find['contract_time']=$contract['create_time'];
|
||||||
}else{
|
}else{
|
||||||
$find['contract_url']='';
|
$find['contract_url']='';
|
||||||
|
$find['contract_time']='';
|
||||||
}
|
}
|
||||||
return $this->success('ok',$find);
|
return $this->success('ok',$find);
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,10 @@ use app\common\model\task_scheduling\TaskScheduling;
|
|||||||
* Class IndexController
|
* Class IndexController
|
||||||
* @package app\api\controller
|
* @package app\api\controller
|
||||||
*/
|
*/
|
||||||
class HetongController extends BaseApiController
|
class CronController extends BaseApiController
|
||||||
{
|
{
|
||||||
|
public array $notNeedLogin = ['settlement','task_add'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结算
|
* 结算
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user