diff --git a/common/models/PayT.php b/common/models/PayT.php
index 782f0e1..5602672 100644
--- a/common/models/PayT.php
+++ b/common/models/PayT.php
@@ -338,4 +338,28 @@ class PayT extends \common\models\Base
$bmbaofei = $query->sum('total1_clear');
return round($bmbaofei,2);
}
+
+ public function getStatus($status_id){
+ $res = '';
+ if($status_id == 1){
+ $res = '人事✔';
+ }elseif ($status_id == 2){
+ $res = '出纳✔';
+ }elseif ($status_id == 3){
+ $res = '人事✔,出纳✔';
+ }elseif ($status_id == 4){
+ $res = '财务✔';
+ }elseif ($status_id == 5){
+ $res = '老板✔';
+ }elseif ($status_id == 6){
+ $res = '已发放';
+ }elseif ($status_id == 7){
+ $res = '退回人事';
+ }elseif ($status_id == 8){
+ $res = '退回出纳';
+ }elseif ($status_id == 10){
+ $res = '退回财务';
+ }
+ return $res;
+ }
}
diff --git a/common/models/UserT.php b/common/models/UserT.php
index 3330e70..27e1896 100644
--- a/common/models/UserT.php
+++ b/common/models/UserT.php
@@ -270,4 +270,22 @@ class UserT extends \common\models\Base
return $items;
}
}
+
+ public function getChunaShouldPay($pay_date){
+ $user_id = $this->id;
+ $pay_chexian = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type<>7 and type<>8 and type<>10 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ $pay_nochexian = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=7 and user_id=' . $user_id)
+ ->orWhere('pay_date="' . $pay_date . '" and type=8 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ $pay_dz = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=10 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ return $pay_chexian + $pay_nochexian + $pay_dz;
+ }
}
diff --git a/common/models/ZhongjiFanxianT.php b/common/models/ZhongjiFanxianT.php
new file mode 100644
index 0000000..32b9668
--- /dev/null
+++ b/common/models/ZhongjiFanxianT.php
@@ -0,0 +1,62 @@
+ 'ID',
+ 'celuo_id' => 'Celuo ID',
+ 'fanxian_rate' => 'Fanxian Rate',
+ 'created_at' => 'Created At',
+ 'updated_at' => 'Updated At',
+ ];
+ }
+
+ public function getTiaojian() {
+ return $this->hasOne(ZhongjiTiaojian::className(),['id'=>'tiaojian_id']);
+ }
+
+ public function getCeluo() {
+ return $this->hasOne(ZhongjiYingxiao::className(), ['id'=>'celuo_id']);
+ }
+}
diff --git a/common/models/ZhongjiGiftT.php b/common/models/ZhongjiGiftT.php
new file mode 100644
index 0000000..3f442fa
--- /dev/null
+++ b/common/models/ZhongjiGiftT.php
@@ -0,0 +1,62 @@
+ 'ID',
+ 'celuo_id' => 'Celuo ID',
+ 'fanxian_id' => 'Fanxian ID',
+ 'n' => 'n',
+ 'gift_type' => 'Gift Type',
+ 'free_type' => 'Free Type',
+ 'gift_ids' => 'Gift Ids',
+ 'created_at' => 'Created At',
+ 'updated_at' => 'Updated At',
+ ];
+ }
+}
diff --git a/common/models/ZhongjiUserT.php b/common/models/ZhongjiUserT.php
new file mode 100644
index 0000000..13ec794
--- /dev/null
+++ b/common/models/ZhongjiUserT.php
@@ -0,0 +1,54 @@
+ 'ID',
+ 'celuo_id' => 'Celuo ID',
+ 'user_id' => 'User ID',
+ 'created_at' => 'Created At',
+ 'updated_at' => 'Updated At',
+ ];
+ }
+
+ public function getUser() {
+ return $this->hasOne(UserT::className(),['id'=>'user_id']);
+ }
+}
diff --git a/frontend/controllers/FinanceController.php b/frontend/controllers/FinanceController.php
index ab505fe..4a1673e 100644
--- a/frontend/controllers/FinanceController.php
+++ b/frontend/controllers/FinanceController.php
@@ -21,6 +21,7 @@ use common\models\CarCT;
use common\models\CarDT;
use common\models\CarET;
use common\models\CarInvalidT;
+use common\models\GiftT;
use common\models\ImportLogT;
use common\models\CompanyT;
use common\models\EmsT;
@@ -6570,4 +6571,1116 @@ class FinanceController extends \frontend\controllers\UserBaseController
return $result;
}
+
+ public function actionBudianList()
+ {
+ $request = Yii::$app->request;
+ $begin_date = $request->get('begin_date',date('Y-m-d'));
+ $end_date = $request->get('end_date',date('Y-m-d'));
+ $begin_totalclear = $request->get('begin_totalclear');
+ $end_totalclear = $request->get('end_totalclear');
+ $car_no_type = $request->get('car_no_type');
+ $company_id = $request->get('company_id');
+ $insurer_type = $request->get('insurer_type');
+
+
+ $budian_rate = $request->get('budian_rate');
+
+ $page = $request->get('page',1);
+
+
+
+
+ $query = CaiwuT::find()
+ ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
+// ->where('caiwu_t.insurer_type=1')
+ ->orderBy('order_t.print_date DESC');
+
+
+ if( $insurer_type > 0) {
+ $query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type);
+ }
+
+
+ if( $company_id > 0) {
+ $query = $query->andWhere('order_t.company_id='.$company_id);
+ }
+
+ if($car_no_type == 1){
+ $query = $query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
+ }elseif($car_no_type == 2){
+ $query = $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"');
+ }
+
+ if($begin_totalclear != ''){
+ $query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
+ }
+ if($end_totalclear != ''){
+ $query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
+ }
+
+
+ if ($begin_date != "") {
+ $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"');
+ }
+ if ($end_date != "") {
+ $query = $query->andWhere('order_t.print_date<="' . $end_date . '"');
+ }
+
+ $total1_clear_all = $query->sum('total_clear');
+ $total_money_all = $query->sum('budian_money');
+
+ $total = $query->count();
+
+ $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
+ $pagination->setPage($page-1);
+
+ $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $items = $query->all();
+
+ $page_info = MyLib::getPageInfo($pagination);
+
+ $company_items = InsurerCompanyT::find()->all();
+
+
+// $insurer_ticheng_items = InsurerTichengT::find()->orderBy('id')->all();
+// $gift_ticheng_items = InsurerTichengGiftT::find()->orderBy('id')->all();
+
+ return $this->render('budian-list', [
+ 'total1_clear_all'=>$total1_clear_all,
+ 'total_money_all'=>$total_money_all,
+ 'items' => $items,
+ 'page' => $page,
+ 'page_info' => $page_info,
+ 'begin_date' => $begin_date,
+ 'end_date' => $end_date,
+ 'company_items' => $company_items,
+ 'begin_totalclear' => $begin_totalclear,
+ 'end_totalclear' => $end_totalclear,
+ 'car_no_type' => $car_no_type,
+ 'company_id' => $company_id,
+ 'budian_rate' => $budian_rate,
+ 'insurer_type' => $insurer_type
+// 'insurer_ticheng_items' => $insurer_ticheng_items,
+// 'gift_ticheng_items' => $gift_ticheng_items
+ ]);
+ }
+
+ public function actionBudianSave()
+
+ {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result = array();
+ $result['success'] = false;
+ $result['msg'] = '操作失败';
+
+
+ $begin_date = $request->get('begin_date');
+ $end_date = $request->get('end_date');
+ $user_names = $request->get('user_names');
+ $begin_totalclear = $request->get('begin_totalclear');
+ $end_totalclear = $request->get('end_totalclear');
+ $car_no_type = $request->get('car_no_type');
+ $company_id = $request->get('company_id');
+ $insurer_type = $request->get('insurer_type');
+
+
+
+
+ $budian_rate = $request->get('budian_rate');
+
+
+ $query = CaiwuT::find()
+ ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
+// ->where('caiwu_t.insurer_type=1')
+ ->orderBy('order_t.print_date DESC');
+
+ if( $insurer_type > 0) {
+ $query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type);
+ }
+
+ if( $company_id > 0) {
+ $query = $query->andWhere('order_t.company_id='.$company_id);
+ }
+
+ if($car_no_type == 1){
+ $query = $query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
+ }elseif($car_no_type == 2){
+ $query = $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"');
+ }
+
+ if($begin_totalclear != ''){
+ $query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
+ }
+ if($end_totalclear != ''){
+ $query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
+ }
+
+
+ if ($begin_date != "") {
+ $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"');
+ }
+ if ($end_date != "") {
+ $query = $query->andWhere('order_t.print_date<="' . $end_date . '"');
+ }
+
+
+ $items = $query->all();
+
+
+
+ $tran = OrderCaiwuT::getDb()->beginTransaction();
+ try {
+ foreach ($items as $item){
+// $order_caiwu_info = $item->orderCaiwu;
+// $order_info = $item->order;
+
+ if($budian_rate != '') {
+ $item->budian_rate = $budian_rate;
+ $item->budian_money = $item->total_clear * $budian_rate / 100;
+ }
+ $item->save();
+
+ }
+
+ $result['success'] = true;
+ $result['msg'] = '保存成功';
+ $tran->commit();
+
+ } catch(\Exception $e) {
+ $tran->rollBack();
+ throw $e;
+ }
+
+ return $result;
+ }
+
+ public function actionTichengJisuan()
+ {
+ $request = Yii::$app->request;
+ $begin_date = $request->get('begin_date',date('Y-m-d'));
+ $end_date = $request->get('end_date',date('Y-m-d'));
+ $begin_totalclear = $request->get('begin_totalclear');
+ $end_totalclear = $request->get('end_totalclear');
+ $car_no_type = $request->get('car_no_type');
+ $company_id = $request->get('company_id');
+ $user_names = $request->get('user_names');
+ $car_no = $request->get('car_no');
+ $insurer_type = $request->get('insurer_type',1);
+
+ $dz_group = $request->get('dz_group');
+ $dz_rate = $request->get('dz_rate');
+ $dz_names = $request->get('dz_names');
+
+ $base_rate = $request->get('base_rate');
+ $xiaoyi_rate1 = $request->get('xiaoyi_rate1');
+ $xiaoyi_rate2 = $request->get('xiaoyi_rate2');
+ $online_rate = $request->get('online_rate');
+ $yeji_rate = $request->get('yeji_rate');
+ $gift1 = $request->get('gift1');
+ $gift2 = $request->get('gift2');
+ $gift3 = $request->get('gift3');
+ $gift4 = $request->get('gift4');
+ $gift5 = $request->get('gift5');
+ $ticket1 = $request->get('ticket1');
+ $ticket2 = $request->get('ticket2');
+ $ticket3 = $request->get('ticket3');
+ $zhengben_ticheng = $request->get('zhengben_ticheng');
+ $hebao_ticheng = $request->get('hebao_ticheng');
+ $songdan_ticheng = $request->get('songdan_ticheng');
+ $genzong_ticheng = $request->get('genzong_ticheng');
+ $first_xinbao_rate = $request->get('first_xinbao_rate');
+ $xianzhong_rate = $request->get('xianzhong_rate');
+
+
+ $is_fan= $request->get('is_fan',0);
+
+
+
+ $page = $request->get('page',1);
+ if($page < 1) $page = 1;
+
+
+ $group_id = $request->get('group_id');
+ $group_items = GroupT::getTree((int)$this->my->group_id);
+ if($this->my->id == 1 || $this->my->username=='6002' || $this->my->username=='7053')
+ $group_items = GroupT::getTree();
+ $group_ids[] = $group_id;
+
+ if($group_id > 0) {
+ $items = GroupT::getTree($group_id);
+
+ foreach($items as $group_info) {
+ $group_ids[] = $group_info->id;
+ }
+ }
+
+
+ $query = CaiwuT::find()
+ ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
+ ->where('order_t.status_id>1')
+ ->orderBy('order_t.print_date DESC');
+
+ if($user_names != '' && $user_names != 'null'){
+ $user_arr = explode(',',$user_names);
+ $user_ids = [];
+ foreach ($user_arr as $user){
+ $username = substr($user,0,strpos($user, '('));
+ $user = UserT::find()->where('is_delete=0')->andWhere('username="'.$username.'"')->one();
+ if($user)
+ $user_ids[] = $user->id;
+ }
+
+ if($is_fan == 1){
+ $query = $query->andWhere(['not in','caiwu_t.user_id',$user_ids]);
+ }else{
+ $query = $query->andWhere(['in','caiwu_t.user_id',$user_ids]);
+ }
+
+ }
+
+ if( $company_id > 0) {
+ $query = $query->andWhere('order_t.company_id='.$company_id);
+ }
+ if( $car_no != '') {
+ $query = $query->andWhere('order_t.car_no="'.$car_no.'"');
+ }
+
+ if($car_no_type == 1){
+ $query = $query->andWhere('caiwu_t.car_no like "' . '京' . '%"');
+ }elseif($car_no_type == 2){
+ $query = $query->andWhere('caiwu_t.car_no not like "' . '京' . '%"');
+ }
+
+ if($begin_totalclear != ''){
+ $query = $query->andWhere('caiwu_t.total_clear >=' . $begin_totalclear);
+ }
+ if($end_totalclear != ''){
+ $query = $query->andWhere('caiwu_t.total_clear <=' . $end_totalclear);
+ }
+
+
+ if ($begin_date != "") {
+ $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"');
+ }
+ if ($end_date != "") {
+ $query = $query->andWhere('order_t.print_date<="' . $end_date . '"');
+ }
+
+
+ $user_items = $this->my->getChildren('');
+ if($this->my->username == '6002' || $this->my->username == '7053')
+ $user_items = $this->my->getChildren('',1);
+ $user_items[] = $this->my;
+
+ $row = array();
+ foreach($user_items as $user_info) {
+// if ($user_info->is_leave == 1) continue;
+// var_dump($user_info);
+ if ($group_id > 0) {
+ if (!in_array($user_info->group_id, $group_ids)) {
+ continue;
+ }
+ }
+
+ $row[] = $user_info->id;
+
+ }
+
+// var_dump($row);
+ //加上级别筛选
+ if($group_id > 0){
+ if($is_fan == 1){
+ $query = $query->andWhere(['not in','caiwu_t.user_id',$row]);
+ }else{
+ $query = $query->andWhere(['in','caiwu_t.user_id',$row]);
+ }
+
+ }
+
+
+
+ $query1 = clone $query;
+ if($insurer_type ==1){
+ $query = $query->andWhere('caiwu_t.insurer_type=1');
+ }
+
+
+ $items = $query->all();
+
+//echo $query->createCommand()->rawSql;
+
+ $total2_clear_all = $query1->andWhere('caiwu_t.insurer_type=2')->sum('total_clear');
+
+ $yewu_ticheng_all = 0;
+ $total1_clear_all = 0;
+ $yeji_ticheng_all = 0;
+ $ticheng_money_all = 0;
+ $lipin_all = 0;
+ $liquan_all = 0;
+ $yuangong_money_all = 0;
+ foreach($items as $index => $item) {
+
+ $order_caiwu_info = $item->orderCaiwu;
+ $order_info = $item->order;
+
+ $total1_clear_all += $item->total_clear;
+ $yewu_ticheng_all += $order_caiwu_info ? $order_caiwu_info->yewu_ticheng : 0;
+ $yeji_ticheng_all += $order_caiwu_info ? $order_caiwu_info->yeji_ticheng : 0;
+ $ticheng_money_all += $order_info ? $order_info->ticheng_money : 0;
+ $lipin_all += $order_info ? $order_info->getGiftPrice(1,1) : 0;
+ $liquan_all += $order_info ? $order_info->getGiftPrice(1,2) : 0;
+ $yuangong_money = 0;
+ if($order_info){
+ $yuangong_money = $order_info->yuangong_money>0?$order_info->yuangong_money:0;
+ }
+ $yuangong_money_all += $yuangong_money;
+
+ }
+// $sum_r_total = $query->sum('r_total');
+// //商业净保费综合
+// $sum_total_clear = $query->sum('total_clear'); //是错误的
+//
+// //商业总保费
+// $sum_total = $query->sum('total');
+//
+// $sum_total_dis = $query->sum('total_dis');
+
+
+ $total = $query->count();
+
+ $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
+ $pagination->setPage($page-1);
+
+ $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $items = $query->all();
+
+ $page_info = MyLib::getPageInfo($pagination);
+
+
+
+
+ $company_items = InsurerCompanyT::find()->all();
+
+ $user_items = UserT::find()
+ ->where('is_delete=0')
+ ->orderBy('username ASC')
+ ->all();
+//
+// $insurer_ticheng_items = InsurerTichengT::find()->orderBy('id')->all();
+// $gift_ticheng_items = InsurerTichengGiftT::find()->orderBy('id')->all();
+ $gift_items = GiftT::find()->where('type_id=1')->orderBy('id')->all();
+ $ticket_items = GiftT::find()->where('type_id=2')->orderBy('id')->all();
+
+ return $this->render('ticheng-jisuan', [
+ 'items' => $items,
+ 'page_info' => $page_info,
+ 'begin_date' => $begin_date,
+ 'end_date' => $end_date,
+// 'sum_r_total' => $sum_r_total,
+// 'sum_total_clear' => $sum_total_clear,
+// 'sum_total' => $sum_total,
+// 'sum_total_dis' => $sum_total_dis,
+ 'company_items' => $company_items,
+ 'begin_totalclear' => $begin_totalclear,
+ 'end_totalclear' => $end_totalclear,
+ 'car_no_type' => $car_no_type,
+ 'company_id' => $company_id,
+ 'car_no' =>$car_no,
+ 'is_fan' =>$is_fan,
+ 'insurer_type' =>$insurer_type,
+ 'user_names' =>$user_names,
+ 'dz_group'=>$dz_group,
+ 'dz_rate' =>$dz_rate,
+ 'dz_names' =>$dz_names,
+ 'group_id'=>$group_id,
+ 'group_items'=>$group_items,
+
+ 'base_rate' => $base_rate,
+ 'xiaoyi_rate1' => $xiaoyi_rate1,
+ 'xiaoyi_rate2' => $xiaoyi_rate2,
+ 'online_rate' => $online_rate,
+ 'yeji_rate' => $yeji_rate,
+ 'gift1' => $gift1,
+ 'gift2' => $gift2,
+ 'gift3' => $gift3,
+ 'gift4' => $gift4,
+ 'gift5' => $gift5,
+ 'ticket1' => $ticket1,
+ 'ticket2' => $ticket2,
+ 'ticket3' => $ticket3,
+ 'zhengben_ticheng' => $zhengben_ticheng,
+ 'hebao_ticheng' => $hebao_ticheng,
+ 'songdan_ticheng' => $songdan_ticheng,
+ 'genzong_ticheng' => $genzong_ticheng,
+ 'first_xinbao_rate' => $first_xinbao_rate,
+ 'xianzhong_rate' => $xianzhong_rate,
+ 'user_items' => $user_items,
+ 'gift_items'=>$gift_items,
+ 'ticket_items'=>$ticket_items,
+ 'ticheng_money_all'=>$ticheng_money_all,
+ 'total1_clear_all'=>$total1_clear_all,
+ 'total2_clear_all'=>$total2_clear_all,
+ 'yewu_ticheng_all'=>$yewu_ticheng_all,
+ 'yeji_ticheng_all'=>$yeji_ticheng_all,
+ 'ticheng_money_all'=>$ticheng_money_all,
+ 'lipin_all'=>$lipin_all,
+ 'liquan_all'=>$liquan_all,
+ 'yuangong_money_all'=>$yuangong_money_all,
+
+// 'insurer_ticheng_items' => $insurer_ticheng_items,
+// 'gift_ticheng_items' => $gift_ticheng_items
+ ]);
+ }
+ /**
+ * 出纳工资列表
+ * @return string
+ */
+ public function actionChunaGongziList()
+ {
+ $request = Yii::$app->request;
+ $username = $request->get('username');
+ $name = $request->get('name');
+ $pay_date = $request->get('pay_date', date('Y-m'));
+ $group_id = $request->get('group_id', 0);
+ $page = $request->get('page', 1);
+
+ $status_id = $request->get('status_id',0);
+
+ $user_id = $this->my->id;
+// var_dump($user_id);
+ $query = UserT::find()
+ ->leftJoin('pay_t','pay_t.user_id=user_t.id')
+ ->where('group_id>0 and is_delete=0');
+ if ($username != '') {
+ $query = $query->andWhere('username like "' . $username . '"');
+ }
+ if ($name != '') {
+ $query = $query->andWhere('name like "' . $name . '"');
+ }
+ if ($group_id > 0) {
+ $query = $query->andWhere('group_id=' . $group_id);
+ }
+ if($status_id > 0) {
+ $query = $query->andWhere('pay_t.status_id='.$status_id);
+ }
+ $query = $query->orderBy('username ASC,id ASC');
+ $total = $query->count();
+ $total_real_pay = 0;
+ foreach ($query->each() as $item) {
+ $pay_info = $item->getPay($pay_date);
+ if ($pay_info)
+ $total_real_pay += $pay_info->real_pay;
+ }
+
+ $pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]);
+ $pagination->setPage($page - 1);
+
+ $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $items = $query->all();
+
+ $page_info = MyLib::getPageInfo($pagination);
+
+ $group_items = GroupT::getTree();
+
+ $return_count = UserT::find()
+ ->leftJoin('pay_t','pay_t.user_id=user_t.id')
+ ->where('user_t.group_id>0 and is_delete=0')
+ ->andWhere('pay_t.pay_date="'.$pay_date.'"')
+ ->andWhere('pay_t.status_id=8')
+ ->count();
+
+ return $this->render('chuna-gongzi-list', [
+ 'group_items' => $group_items,
+ 'items' => $items,
+ 'page_info' => $page_info,
+ 'page' => $page,
+ 'username' => $username,
+ 'name' => $name,
+ 'pay_date' => $pay_date,
+ 'group_id' => $group_id,
+ 'total_real_pay' => $total_real_pay,
+ 'status_id'=>$status_id,
+ 'return_count' => $return_count
+ ]);
+ }
+ /**
+ * 出纳工资-详情
+ * @return string
+ */
+ public function actionChunaGongziInfo()
+ {
+ $request = Yii::$app->request;
+ $user_id = $request->get('id', 0);
+ $pay_date = $request->get('pay_date', date('Y-m'));
+ $back_params = $request->get('back_params');
+
+ $user_info = UserT::findOne(['id' => $user_id]);
+ $group_info = $user_info->group;
+
+// $work_day = WorkDayT::findOne(['date' => $pay_date]);
+
+// if (!$work_day) {
+// echo $pay_date . '还没有开始统计';
+// echo "[返回]";
+// die;
+// }
+
+ $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]);
+ if (!$pay_info) {
+ $pay_info = new PayT();
+ $pay_info->user_id = $user_id;
+ $pay_info->pay_date = $pay_date;
+ if ($group_info) {
+ $pay_info->should_pay = $group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay;
+ } else {
+ $pay_info->should_pay = $user_info->ext_pay;
+ }
+ if (!$pay_info->save()) {
+ var_dump($pay_info->errors);
+ exit;
+ }
+ $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]);
+ }
+ //内勤
+ //核保
+ $my_type5_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=5 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+// echo $my_type5_query->createCommand()->rawSql;
+ //正本
+ $my_type6_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=6 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+
+ //新保
+ $my_type1_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id .' and is_own =1')
+ ->orderBy('created_at asc');
+ //原新保
+ $my_type0_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id.' and is_own =0')
+ ->orderBy('created_at asc');
+ //非车险
+ $my_type1_query_non = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=7 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+ //非车险核保
+ $my_type1_query_hebao = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=8 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+
+ //外区
+ $my_out_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id .' and (is_own=4 or is_own=5)')
+ ->orderBy('created_at asc');
+
+
+
+// echo $my_type1_query->createCommand()->rawSql;
+ //续保
+ $my_type3_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=1 and type=3 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+// echo $my_type3_query->createCommand()->rawSql;
+ //不是核保 正本 送单
+ $type_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type<>4 and type<>5 and type<>6 and is_own=0 and user_id=' . $user_id)
+ ->andWhere('should_pay>0')
+ ->orderBy('created_at asc');
+// echo $type_query->createCommand()->rawSql;
+ //送单
+ $type3_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=4 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+ $pay_order_users = OrderT::find()
+ ->where('print_date like "' . $pay_date . '-%"')
+ ->andWhere('user_id=' . $this->my->id)
+ ->orderBy('updated_at ASC');
+
+
+ $pay_chexian = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type<>7 and type<>8 and type<>10 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ $pay_nochexian = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=7 and user_id=' . $user_id)
+ ->orWhere('pay_date="' . $pay_date . '" and type=8 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ $pay_dz = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=10 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ return $this->render('chuna-gongzi-info', [
+ 'pay_date' => $pay_date,
+ 'user_info' => $user_info,
+ 'group_info' => $group_info,
+ 'pay_info' => $pay_info,
+ 'my_type0_query' => $my_type0_query,
+ 'my_type1_query' => $my_type1_query,
+ 'my_type3_query' => $my_type3_query,
+ 'my_type5_query' => $my_type5_query,
+ 'my_type6_query' => $my_type6_query,
+ 'my_out_query' => $my_out_query,
+ 'my_type1_query_non' => $my_type1_query_non,
+ 'my_type1_query_hebao' => $my_type1_query_hebao,
+ 'type_query' => $type_query,
+ 'type3_query' => $type3_query,
+ 'back_params' => $back_params,
+ 'pay_order_users' => $pay_order_users,
+ 'pay_chexian' => $pay_chexian,
+ 'pay_nochexian' => $pay_nochexian,
+ 'pay_dz' => $pay_dz
+ ]);
+ }
+ /**
+ * 财务工资列表
+ * @return string
+ */
+ public function actionGongziAllList()
+ {
+ $request = Yii::$app->request;
+ $username = $request->get('username');
+ $name = $request->get('name');
+ $pay_date = $request->get('pay_date', date('Y-m'));
+ $group_id = $request->get('group_id', 0);
+ $page = $request->get('page', 1);
+
+ $status_id = $request->get('status_id',0);
+
+ $user_id = $this->my->id;
+// var_dump($user_id);
+ $query = UserT::find()
+ ->leftJoin('pay_t','pay_t.user_id=user_t.id')
+ ->where('group_id>0 and is_delete=0');
+ if ($username != '') {
+ $query = $query->andWhere('username like "' . $username . '"');
+ }
+ if ($name != '') {
+ $query = $query->andWhere('name like "' . $name . '"');
+ }
+ if ($group_id > 0) {
+ $query = $query->andWhere('group_id=' . $group_id);
+ }
+
+ if($status_id > 0) {
+ $query = $query->andWhere(['IN','pay_t.status_id',[7,8,9]]);
+ }
+ $query = $query->orderBy('username ASC,id ASC');
+ $total = $query->count();
+ $total_real_pay = 0;
+ foreach ($query->each() as $item) {
+ $pay_info = $item->getPay($pay_date);
+ if ($pay_info)
+ $total_real_pay += $pay_info->real_pay;
+ }
+
+ $pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]);
+ $pagination->setPage($page - 1);
+
+ $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $items = $query->all();
+
+ $page_info = MyLib::getPageInfo($pagination);
+
+ $group_items = GroupT::getTree();
+
+ return $this->render('gongzi-all-list', [
+ 'group_items' => $group_items,
+ 'items' => $items,
+ 'page_info' => $page_info,
+ 'page' => $page,
+ 'username' => $username,
+ 'name' => $name,
+ 'pay_date' => $pay_date,
+ 'group_id' => $group_id,
+ 'total_real_pay' => $total_real_pay,
+ 'status_id' => $status_id
+ ]);
+ }
+ /**
+ * 出纳工资-详情
+ * @return string
+ */
+ public function actionGongziAllInfo()
+ {
+ $request = Yii::$app->request;
+ $user_id = $request->get('id', 0);
+ $pay_date = $request->get('pay_date', date('Y-m'));
+ $back_params = $request->get('back_params');
+
+ $user_info = UserT::findOne(['id' => $user_id]);
+ $group_info = $user_info->group;
+
+ $work_day = WorkDayT::findOne(['date' => $pay_date]);
+
+ if (!$work_day) {
+ echo $pay_date . '还没有开始统计';
+ echo "[返回]";
+ die;
+ }
+
+ $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]);
+ if (!$pay_info) {
+ $pay_info = new PayT();
+ $pay_info->user_id = $user_id;
+ $pay_info->pay_date = $pay_date;
+ if ($group_info) {
+ $pay_info->should_pay = $group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay;
+ } else {
+ $pay_info->should_pay = $user_info->ext_pay;
+ }
+ if (!$pay_info->save()) {
+ var_dump($pay_info->errors);
+ exit;
+ }
+ $pay_info = PayT::findOne(['user_id' => $user_id, 'pay_date' => $pay_date]);
+ }
+ //内勤
+ //核保
+ $my_type5_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=5 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+// echo $my_type5_query->createCommand()->rawSql;
+ //正本
+ $my_type6_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=6 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+
+ //新保
+ $my_type1_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=1 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+ //非车险
+ $my_type1_query_non = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=7 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+ //非车险核保
+ $my_type1_query_hebao = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=0 and type=8 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+
+
+
+
+
+// echo $my_type1_query->createCommand()->rawSql;
+ //续保
+ $my_type3_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and is_own=1 and type=3 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+// echo $my_type3_query->createCommand()->rawSql;
+ //不是核保 正本 送单
+ $type_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type<>4 and type<>5 and type<>6 and is_own=0 and user_id=' . $user_id)
+ ->andWhere('should_pay>0')
+ ->orderBy('created_at asc');
+// echo $type_query->createCommand()->rawSql;
+ //送单
+ $type3_query = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=4 and user_id=' . $user_id)
+ ->orderBy('created_at asc');
+ $pay_order_users = OrderT::find()
+ ->where('print_date like "' . $pay_date . '-%"')
+ ->andWhere('user_id=' . $this->my->id)
+ ->orderBy('updated_at ASC');
+
+
+ $pay_chexian = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type<>7 and type<>8 and type<>10 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ $pay_nochexian = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=7 and type=8 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ $pay_dz = PayOrderUserT::find()
+ ->where('pay_date="' . $pay_date . '" and type=10 and user_id=' . $user_id)
+ ->sum('real_pay');
+
+ return $this->render('gongzi-all-info', [
+ 'pay_date' => $pay_date,
+ 'user_info' => $user_info,
+ 'group_info' => $group_info,
+ 'pay_info' => $pay_info,
+ 'my_type1_query' => $my_type1_query,
+ 'my_type3_query' => $my_type3_query,
+ 'my_type5_query' => $my_type5_query,
+ 'my_type6_query' => $my_type6_query,
+ 'my_type1_query_non' => $my_type1_query_non,
+ 'my_type1_query_hebao' => $my_type1_query_hebao,
+ 'type_query' => $type_query,
+ 'type3_query' => $type3_query,
+ 'back_params' => $back_params,
+ 'pay_order_users' => $pay_order_users,
+ 'pay_chexian' => $pay_chexian,
+ 'pay_nochexian' => $pay_nochexian,
+ 'pay_dz' => $pay_dz
+ ]);
+ }
+
+ public function actionReceiptLirun()
+ {
+ set_time_limit(0);
+ ini_set('memory_limit', '3072M');
+ $request = Yii::$app->request;
+ $page = $request->get('page', 1);
+ $insurer_type = $request->get('insurer_type', 0);
+ $begin_date = $request->get('begin_date',date('Y-m-d'));
+ $end_date = $request->get('end_date',date('Y-m-d'));
+ $r_begin_date = $request->get('r_begin_date');
+ $r_end_date = $request->get('r_end_date');
+ $car_no = trim($request->get('car_no'));
+ $insurer_no = trim($request->get('insurer_no'));
+ $status = $request->get('status',0);
+ $sort_key = $request->get('sort_key');
+ $sort_value = $request->get('sort_value');
+ $company_id = $request->get('company_id');
+ $username = $request->get('username');
+ $hebaoname = $request->get('hebaoname');
+ $zbname = $request->get('zbname');
+ //级别
+ $group_id = $request->get('group_id');
+ $group_items = GroupT::getTree((int)$this->my->group_id);
+ if($this->my->id == 1 || $this->my->username=='6002' || $this->my->username=='7053')
+ $group_items = GroupT::getTree();
+ $group_ids[] = $group_id;
+
+ if($group_id > 0) {
+ $items = GroupT::getTree($group_id);
+
+ foreach($items as $group_info) {
+ $group_ids[] = $group_info->id;
+ }
+ }
+// var_dump($group_ids);
+
+ if ($page < 1) $page = 1;
+
+ $query = CaiwuT::find()
+ ->leftJoin(OrderT::tableName(), "order_t.id=caiwu_t.order_id")
+ ->where('order_t.status_id>1');
+// ->orderBy('order_t.print_date DESC');
+
+ switch ($sort_key) {
+ case 'total':
+ $sort = 'caiwu_t.total ';
+ break;
+ case 'total_clear':
+ $sort = 'caiwu_t.total_clear ';
+ break;
+ case 'total_rate':
+ $sort = 'caiwu_t.total_rate ';
+ break;
+ case 'print_date'://默认按照print_date排序
+ default:
+ $sort = 'order_t.print_date ';
+ break;
+ }
+
+ switch ($sort_value) {
+ case 'ASC':
+ $sort .= 'ASC';
+ break;
+ case 'DESC':
+ default:
+ $sort .= 'DESC';
+ break;
+ }
+
+ $query = $query->orderBy($sort);
+
+ if( $insurer_type != 0) {
+ $query = $query->andWhere('caiwu_t.insurer_type='.$insurer_type);
+ }
+
+ if( $company_id > 0) {
+ $query = $query->andWhere('order_t.company_id='.$company_id);
+ }
+ if ($username != "") {
+// $userdata = UserT::findOne(['username'=>$username]);
+ $userdata = UserT::find()->where('username="'.$username.'"')->andwhere('is_leave=0')->one();
+ if($userdata){
+ $query = $query->andWhere('caiwu_t.user_id = ' . $userdata->id . '');
+ }
+ }
+
+ if ($hebaoname != "") {
+// $userdata = UserT::findOne(['username'=>$username]);
+ $userdata = UserT::find()->where('username="'.$hebaoname.'"')->andwhere('is_leave=0')->one();
+ if($userdata){
+ $query = $query->andWhere('order_t.op1_id = ' . $userdata->id . '');
+ }
+ }
+
+ if ($zbname != "") {
+// $userdata = UserT::findOne(['username'=>$username]);
+ $userdata = UserT::find()->where('username="'.$zbname.'"')->andwhere('is_leave=0')->one();
+ if($userdata){
+ $query = $query->andWhere('order_t.op2_id = ' . $userdata->id . '');
+ }
+ }
+
+ if ($car_no != "") {
+ $query = $query->andWhere('caiwu_t.car_no like "%' . $car_no . '%"');
+ }
+
+ if ($insurer_no != "") {
+ $query = $query->andWhere('caiwu_t.insurer_no like "' . $insurer_no . '%"');
+ }
+ if ($status > 0) {
+ if ($status == 1) {
+ $query = $query->andWhere('r_date="" or r_date is null');
+ }
+ if ($status == 2) {
+ $query = $query->andWhere('r_date<>"" and total_dis=0');
+ }
+ if($status == 3) {
+ $query = $query->andWhere('r_date<>"" and total_dis<>0');
+ }
+ }
+ if ($begin_date != "") {
+ $query = $query->andWhere('order_t.print_date>="' . $begin_date . '"');
+ }
+ if ($end_date != "") {
+ $query = $query->andWhere('order_t.print_date<="' . $end_date . '"');
+ }
+ if ($r_begin_date != "") {
+ $query = $query->andWhere('caiwu_t.r_date>="' . $r_begin_date . '"');
+ }
+ if ($r_end_date != "") {
+ $query = $query->andWhere('caiwu_t.r_date<="' . $r_end_date . '"');
+ }
+ //找出$group_id 有多少在职的user_ids
+ // 现在的搜索条件
+ $userSql = '';
+// if($username != '') {
+// $userSql = ' username like "'.$username.'" and ';
+// }
+ //$userSql .= 'is_locked=0 and is_login=1';
+
+ $user_items = $this->my->getChildren($userSql);
+ if($this->my->username == '6002' || $this->my->username == '7053')
+ $user_items = $this->my->getChildren($userSql,1);
+ $user_items[] = $this->my;
+
+ $row = array();
+ foreach($user_items as $user_info) {
+// if ($user_info->is_leave == 1) continue;
+// var_dump($user_info);
+ if ($group_id > 0) {
+ if (!in_array($user_info->group_id, $group_ids)) {
+ continue;
+ }
+ }
+
+ $row[] = $user_info->id;
+
+ }
+
+// var_dump($row);
+ //加上级别筛选
+ if($group_id > 0){
+// $query = $query->andWhere('order_t.company_id='.$company_id);
+ $query = $query->andWhere(['in','caiwu_t.user_id',$row]);
+// $query = $query->andWhere('caiwu_t.user_id ="' . $group_id . '"');
+ }
+
+ $query1 = clone $query;
+
+
+ $item1s = $query1->all();
+
+// echo $query->createCommand()->rawSql;
+ $total = $query->count();
+
+ $sum_r_total = $query->sum('r_total');
+ //商业净保费综合
+ $sum_total_clear = $query->sum('total_clear'); //是错误的
+
+ //商业总保费
+ $sum_total = $query->sum('total');
+
+ $sum_total_dis = $query->sum('total_dis');
+
+ $pagination = new Pagination(['totalCount' => $total, 'pageSize' => 20]);
+ $pagination->setPage($page - 1);
+
+ $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $items = $query->all();
+
+ $lirun_all = 0;
+ $gongzi_all = 0;
+ $liwu_all = 0;
+ $total1_dis_all = 0;
+ $bu_dian_all = 0;
+ $r_bu_dian_all = 0;
+ foreach($item1s as $item){
+
+
+ $order_info = $item->order;
+
+ $total_clear_real = $item->total_clear * $item->total_rate/100;
+ $total1_dis = $item->insurer_type == 1?($order_info->total1_dis + $order_info->yuangong_money):0;
+
+ $gongzi = $item->insurer_type == 1?$item->getPayOrderUser()->sum('real_pay'):0;
+
+ $ticket = $item->insurer_type == 1?$order_info->getGiftPrice(1,1):0;
+ $gift = $item->insurer_type == 1?$order_info->getGiftPrice(1,2):0;
+
+ $r_bu_dian = $item->insurer_type == 1?($item->b1_total+$item->b2_total+$item->b3_total):0;
+ $bu_dian = $item->budian_rate?$item->budian_rate * $item->total_clear / 100:0;
+ $liwu = $ticket + $gift;
+
+ $lirun_all += $total_clear_real + $bu_dian - $total1_dis - $gongzi - $liwu;
+
+ $gongzi_all += $gongzi;
+ $liwu_all += $liwu;
+ $total1_dis_all += $total1_dis;
+ $bu_dian_all += $bu_dian;
+ $r_bu_dian_all += $r_bu_dian;
+
+ }
+
+// var_dump($items);
+
+ $page_info = MyLib::getPageInfo($pagination);
+
+ $company_items = InsurerCompanyT::find()->all();
+
+ return $this->render('receipt-lirun', [
+ 'items' => $items,
+ 'username' => $username,
+ 'hebaoname' => $hebaoname,
+ 'zbname' => $zbname,
+ 'page' => $page,
+ 'car_no' => $car_no,
+ 'insurer_no' => $insurer_no,
+ 'status' => $status,
+ 'begin_date' => $begin_date,
+ 'end_date' => $end_date,
+ 'r_begin_date' => $r_begin_date,
+ 'r_end_date' => $r_end_date,
+ 'page_info' => $page_info,
+ 'sort_key' => $sort_key,
+ 'sort_value' => $sort_value,
+ 'sum_r_total' => $sum_r_total,
+ 'sum_total_clear' => $sum_total_clear,
+ 'sum_total' => $sum_total,
+ 'sum_total_dis' => $sum_total_dis,
+ 'company_items' => $company_items,
+ 'group_id' => $group_id,
+ 'group_items' => $group_items,
+ 'company_id' => $company_id,
+ 'insurer_type' => $insurer_type,
+ 'lirun_all'=>$lirun_all,
+ 'gongzi_all'=>$gongzi_all,
+ 'liwu_all'=>$liwu_all,
+ 'total1_dis_all'=>$total1_dis_all,
+ 'bu_dian_all'=>$bu_dian_all,
+ 'r_bu_dian_all'=>$r_bu_dian_all
+ ]);
+ }
}
diff --git a/frontend/controllers/MarketingStrategyController.php b/frontend/controllers/MarketingStrategyController.php
index d3b6d8c..308b60a 100644
--- a/frontend/controllers/MarketingStrategyController.php
+++ b/frontend/controllers/MarketingStrategyController.php
@@ -4,6 +4,12 @@
namespace frontend\controllers;
+use common\models\GiftT;
+use common\models\UserT;
+use common\models\ZhongjiFanxianT;
+use common\models\ZhongjiGiftT;
+use common\models\ZhongjiTiaojian;
+use common\models\ZhongjiUserT;
use common\models\ZhongjiYingxiao;
use yii\web\Response;
use Yii;
@@ -68,16 +74,14 @@ class MarketingStrategyController extends UserBaseController
$op = $request->post('op', 'add');
$name = $request->post('name');
$begin_date = $request->post('begin_date');
- $begin_time = $request->post('begin_time');
$end_date = $request->post('end_date');
- $end_time = $request->post('end_time');
$remark = $request->post('remark');
if($op == 'add') {
$item = new ZhongjiYingxiao();
$item->celuo_name = $name;
- $item->begin_date = $begin_date.' '.$begin_time.':00';
- $item->end_date = $end_date.' '.$end_time.':00';
+ $item->begin_date = $begin_date;
+ $item->end_date = $end_date;
$item->is_delete = 0;
$item->remark = $remark;
$item->save();
@@ -90,8 +94,8 @@ class MarketingStrategyController extends UserBaseController
$item = ZhongjiYingxiao::findOne(['id'=>$id]);
if($item) {
$item->celuo_name = $name;
- $item->begin_date = $begin_date.' '.$begin_time.':00';
- $item->end_date = $end_date.' '.$end_time.':00';
+ $item->begin_date = $begin_date;
+ $item->end_date = $end_date;
$item->remark = $remark;
$item->save();
@@ -102,6 +106,352 @@ class MarketingStrategyController extends UserBaseController
}
}
return $result;
+ }
+
+ public function actionUsers() {
+ $request = Yii::$app->request;
+ $id = $request->get('id');
+
+ return $this->render('users',['id'=>$id]);
+ }
+
+ public function actionSearchUser() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '没有记录';
+
+ $key = $request->get('key');
+
+ $data = [];
+ if($key != '') {
+ $items = UserT::find()->where('username like "'.$key.'%"')->all();
+ foreach($items as $item) {
+ $row = [];
+ $row['id'] = $item->id;
+ $row['name'] = $item->getShowName();
+ $data[] = $row;
+ }
+ }
+ $result['success'] = true;
+ $result['users'] = $data;
+ $result['msg'] = '共有'.count($items).'条记录';
+ return $result;
+ }
+
+ public function actionUsersAdd() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '保存失败';
+
+ $id = $request->post('id',0);
+ $ids = $request->post('ids');
+
+ foreach($ids as $user_id) {
+ $item = ZhongjiUserT::findOne(['celuo_id'=>$id,'user_id'=>$user_id]);
+ if(!$item) {
+ $item = new ZhongjiUserT();
+ $item->celuo_id = $id;
+ $item->user_id = $user_id;
+ $item->save();
+ }
+ }
+ $result['success'] = true;
+ $result['msg'] = '保存成功';
+ return $result;
+ }
+
+ public function actionUsersRead() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '没有记录';
+
+ $id = $request->get('id');
+
+ $data = [];
+ if($id > 0) {
+ $items = ZhongjiUserT::find()->where('celuo_id='.$id)->all();
+ foreach($items as $item) {
+ if(!$item->user) continue;
+ $row = [];
+ $row['id'] = $item->user->id;
+ $row['name'] = $item->user->getShowName();
+ $data[] = $row;
+ }
+ }
+ $result['success'] = true;
+ $result['users'] = $data;
+ $result['msg'] = '共有'.count($items).'条记录';
+ return $result;
+ }
+
+ public function actionUsersDelete() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '删除失败';
+
+ $id = $request->post('id');
+ $user_id = $request->post('user_id');
+
+ $info = ZhongjiUserT::find()
+ ->where(['celuo_id'=>$id,'user_id'=>$user_id])
+ ->one();
+ if($info) $info->delete();
+ $result['success'] = true;
+ $result['msg'] = '删除成功';
+ return $result;
+ }
+
+ public function actionFanxian() {
+ $request = Yii::$app->request;
+ $celuo_id = $request->get('celuo_id');
+
+ return $this->render('fanxian',['celuo_id'=>$celuo_id]);
+ }
+
+ public function actionFanxianSave() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '保存失败';
+
+ $celuo_id = $request->post('celuo_id',0);
+ $baofei = $request->post('baofei', 0);
+ $car_type_id = $request->post('car_type_id',[]);
+ $company_id = $request->post('company_id', []);
+ $car_use_id = $request->post('car_use_id', []);
+ $type_id = $request->post('type_id', []);
+ $rate = $request->post('rate', 0);
+ $max_cashback = $request->post('max_cashback', 0);
+
+ $tran = ZhongjiTiaojian::getDb()->beginTransaction();
+ try {
+ $tiaojian = new ZhongjiTiaojian();
+ $tiaojian->baofei = floatval($baofei);
+ $tiaojian->fanxian = 0;
+ $tiaojian->xianzhong_one = '';
+ $tiaojian->xianzhong_two = '';
+ $tiaojian->car_type_id = join(',',$car_type_id);
+ $tiaojian->car_use_id = join(',',$car_use_id);
+ $tiaojian->company_ids = join(',',$company_id);
+ $tiaojian->type_ids = join(',',$type_id);
+ $tiaojian->type = 1;
+ $tiaojian->celuo_id = $celuo_id;
+ if(!$tiaojian->save()) {
+ throw new \Exception(print_r($tiaojian->getErrors(), true));
+ }
+ $fanxian = new ZhongjiFanxianT();
+ $fanxian->celuo_id = $celuo_id;
+ $fanxian->tiaojian_id = $tiaojian->id;
+ $fanxian->fanxian_rate = $rate;
+ $fanxian->max_cashback = $max_cashback;
+ $fanxian->save();
+ $tran->commit();
+ } catch (\Exception $e) {
+ $tran->rollBack();
+ $result['msg'] = $e->getMessage();
+ return $result;
+ }
+
+ $result['success'] = true;
+ $result['msg'] = '保存成功';
+ return $result;
+ }
+
+ public function actionFanxianRead() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '没有记录';
+
+ $celuo_id = $request->get('celuo_id');
+
+ $data = [];
+ if($celuo_id > 0) {
+ $items = ZhongjiFanxianT::find()->where('celuo_id='.$celuo_id)->all();
+ foreach($items as $item) {
+ if(!$item->tiaojian) continue;
+ $row = $item->toArray();
+ $row['tiaojian']['baofei'] = $item->tiaojian->baofei;
+
+ $car_type_ids = explode(',',$item->tiaojian->car_type_id);
+ $car_type_names = [];
+ foreach($car_type_ids as $car_type_id) {
+ if($car_type_id == 1) $car_type_names[] = '京牌';
+ if($car_type_id == 2) $car_type_names[] = '非京牌';
+ }
+ $row['tiaojian']['car_type'] = join(',', $car_type_names);
+
+ $car_use_ids = explode(',',$item->tiaojian->car_use_id);
+ $car_use_names = [];
+ foreach($car_use_ids as $car_use_id) {
+ if($car_use_id == 1) $car_use_names[] = '家庭自用车';
+ if($car_use_id == 2) $car_use_names[] = '党政机关、事业团体';
+ if($car_use_id == 3) $car_use_names[] = '非营业企业客车';
+ if($car_use_id == 4) $car_use_names[] = '不区分营业非营业';
+ if($car_use_id == 5) $car_use_names[] = '出租租赁';
+ if($car_use_id == 6) $car_use_names[] = '营业货车';
+ if($car_use_id == 7) $car_use_names[] = '非营业货车';
+ if($car_use_id == 8) $car_use_names[] = '城市公交';
+ }
+ $row['tiaojian']['car_use'] = join(',', $car_use_names);
+
+ $company_ids = explode(',',$item->tiaojian->company_ids);
+ $company_names = [];
+ foreach($company_ids as $company_id) {
+ if($company_id == 1) $company_names[] = '人保';
+ if($company_id == 4) $company_names[] = '太平洋';
+ if($company_id == 7) $company_names[] = '人寿';
+ if($company_id == 8) $company_names[] = '平安';
+ }
+ $row['tiaojian']['company_name'] = join(',', $company_names);
+
+ $type_ids = explode(',',$item->tiaojian->type_ids);
+ $type_names = [];
+ foreach($type_ids as $type_id) {
+ if($type_id == 1) $type_names[] = '新保';
+ if($type_id == 2) $type_names[] = '续保';
+ }
+ //条件
+ $row['tiaojian']['type_name'] = join(',', $type_names);
+ //礼品
+ $row['gifts'] = [];
+ $gifts = ZhongjiGiftT::find()
+ ->where(['fanxian_id'=>$item->id,'gift_type'=>1])
+ ->all();
+ foreach($gifts as $gift) {
+ $tmp_row = [];
+ $tmp_row['id'] = $gift->id;
+ if($gift->free_type == 1) $tmp_row['free_type'] = '免费模式';
+ if($gift->free_type == 2) $tmp_row['free_type'] = '收费模式';
+ if($gift->free_type == 3) $tmp_row['free_type'] = 'M选'.$gift->n.'模式';
+ $tmp_row['gifts'] = json_decode($gift->gift_ids,true);
+ $row['gifts'][] = $tmp_row;
+ }
+ //礼券
+ $row['quans'] = [];
+ $gifts = ZhongjiGiftT::find()
+ ->where(['fanxian_id'=>$item->id,'gift_type'=>2])
+ ->all();
+ foreach($gifts as $gift) {
+ $tmp_row = [];
+ $tmp_row['id'] = $gift->id;
+ if($gift->free_type == 1) $tmp_row['free_type'] = '免费模式';
+ if($gift->free_type == 2) $tmp_row['free_type'] = '收费模式';
+ if($gift->free_type == 3) $tmp_row['free_type'] = 'M选'.$gift->n.'模式';
+ $tmp_row['gifts'] = json_decode($gift->gift_ids,true);
+ $row['quans'][] = $tmp_row;
+ }
+ $data[] = $row;
+ }
+ }
+ $result['success'] = true;
+ $result['fanxians'] = $data;
+ $result['msg'] = '共有'.count($items).'条记录';
+ return $result;
+ }
+
+ public function actionFanxianDelete() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '删除失败';
+
+ $fanxin_id = $request->post('fanxin_id');
+ $user_id = $request->post('user_id');
+
+ $info = ZhongjiFanxianT::find()
+ ->where('id='.$fanxin_id)
+ ->one();
+ if($info) {
+ $info->tiaojian->delete();
+ $items = ZhongjiGiftT::find()
+ ->where(['fanxian_id'=>$info->id])
+ ->all();
+ foreach($items as $item) {
+ $item->delete();
+ }
+ $info->delete();
+ }
+ $result['success'] = true;
+ $result['msg'] = '删除成功';
+ return $result;
+ }
+
+ public function actionGifts() {
+ $request = Yii::$app->request;
+ $celuo_id = $request->get('celuo_id');
+ $fanxian_id = $request->get('fanxian_id');
+
+ $items = GiftT::find()
+ ->where(['type_id'=>1])
+ ->all();
+
+ return $this->render('gifts',[
+ 'celuo_id'=>$celuo_id,
+ 'fanxian_id'=>$fanxian_id,
+ 'items'=>$items
+ ]);
+ }
+
+ public function actionGiftSave() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '保存失败';
+
+ $celuo_id = $request->post('celuo_id',0);
+ $fanxian_id = $request->post('fanxian_id',0);
+ $gift_type = $request->post('gift_type', 1);
+ $free_type = $request->post('free_type', 0);
+ $n = $request->post('n', 0);
+ $gift_ids = $request->post('gift_ids', []);
+ $gift_prices = $request->post('gift_prices', []);
+
+ $gifts = [];
+ foreach($gift_ids as $gift_id) {
+ $tmp_gift = GiftT::find()->where(['id'=>$gift_id])->one();
+ $row = $tmp_gift->toArray();
+ $row['price'] = $gift_prices[$gift_id];
+ $gifts[] = $row;
+ }
+ $item = new ZhongjiGiftT();
+ $item->celuo_id = $celuo_id;
+ $item->fanxian_id = $fanxian_id;
+ $item->gift_type = $gift_type;
+ $item->free_type = $free_type;
+ $item->n = intval($n);
+ $item->gift_ids = json_encode($gifts);
+ if(!$item->save()) {
+ $result['msg'] = print_r($item->getErrors(), true);
+ return $result;
+ }
+
+ $result['success'] = true;
+ $result['msg'] = '保存成功';
+ return $result;
+ }
+ public function actionGiftDelete() {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $result['success'] = false;
+ $result['msg'] = '删除失败';
+
+ $id = $request->post('id');
+ $celuo_id = $request->post('celuo_id');
+
+ $info = ZhongjiGiftT::find()
+ ->where(['id'=>$id,'celuo_id'=>$celuo_id])
+ ->one();
+ if($info) {
+ $info->delete();
+ }
+ $result['success'] = true;
+ $result['msg'] = '删除成功';
+ return $result;
}
}
\ No newline at end of file
diff --git a/frontend/controllers/PersonnelController.php b/frontend/controllers/PersonnelController.php
index aa99a4e..e7294be 100644
--- a/frontend/controllers/PersonnelController.php
+++ b/frontend/controllers/PersonnelController.php
@@ -7,16 +7,16 @@ use common\models\GroupT;
use common\models\PayT;
use common\models\UserT;
use common\models\WorkDayT;
+use common\models\UserLogT;
use Yii;
use yii\data\Pagination;
use yii\web\Response;
use yii\web\UploadedFile;
+use common\models\CompanyT;
class PersonnelController extends \frontend\controllers\UserBaseController
{
public $my = null;
- public $enableCsrfValidation = false;
- public $layout = 'blue-main';
public function init()
{
@@ -40,60 +40,77 @@ class PersonnelController extends \frontend\controllers\UserBaseController
*/
public function actionPayList()
{
- $pay_date = date('Y-m');
- $group_items = GroupT::getTree();
- return $this->render('pay-list',[
- 'group_items' => $group_items,
- 'pay_date' => $pay_date
- ]);
- }
-
- public function actionPayListJson()
- {
- Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$username = $request->get('username');
$name = $request->get('name');
$pay_date = $request->get('pay_date',date('Y-m'));
$group_id = $request->get('group_id',0);
- $is_leave = $request->get('is_leave');
- $offset = $request->get('offset',0);
- $limit = $request->get('limit', 10);
+ $company_id = $request->get('company_id');
+ $page = $request->get('page',1);
+ $is_leave = $request->get('is_leave',0);
+
+ $status_id = $request->get('status_id',0);
$query = UserT::find()
- ->where('group_id>0 and is_delete=0');
+ ->leftJoin('pay_t','pay_t.user_id=user_t.id')
+ ->where('user_t.group_id>0 and is_delete=0');
if($username != '') {
- $query->andWhere('username like "'.$username.'"');
+ $query = $query->andWhere('user_t.username like "'.$username.'"');
}
if($name != '') {
- $query->andWhere('name like "'.$name.'"');
+ $query = $query->andWhere('user_t.name like "'.$name.'"');
+ }
+ if($is_leave != ''){
+ $query = $query->andWhere(['user_t.is_leave' => $is_leave]);
}
- if($is_leave == 'true'){
- $query->andWhere(['is_leave' => 1]);
+ if($company_id > 0) {
+ $query = $query->andWhere('user_t.company_id='.$company_id);
}
if($group_id > 0) {
- $query->andWhere('group_id='.$group_id);
+ $query = $query->andWhere('user_t.group_id='.$group_id);
}
- $query->orderBy('username ASC,id ASC');
+ if($status_id > 0) {
+ $query = $query->andWhere('pay_t.status_id='.$status_id);
+ }
+ $query = $query->orderBy('user_t.username ASC,user_t.id ASC');
$total = $query->count();
- $query = $query->offset($offset)->limit($limit);
+ $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
+ $pagination->setPage($page-1);
+
+ $query = $query->offset($pagination->offset)->limit($pagination->limit);
$items = $query->all();
- $data = [];
- $data['total'] = $total;
- $data['rows'] = [];
- foreach($items as $item) {
- $row = $item->toArray();
- $row['pay_date'] = $pay_date;
- $row['group_path'] = $item->group ? $item->group->getPath():'';
- $pay = $item->getPay($pay_date);
- $row['real_pay'] = $pay ? $pay->real_pay : '0.00';
- $row['is_leave'] = $item->is_leave == 1 ? '已离职':'';
- $data['rows'][] = $row;
- }
+ $page_info = MyLib::getPageInfo($pagination);
- return $data;
+ $group_items = GroupT::getTree();
+
+ $return_count = UserT::find()
+ ->leftJoin('pay_t','pay_t.user_id=user_t.id')
+ ->where('user_t.group_id>0 and is_delete=0')
+ ->andWhere('pay_t.pay_date="'.$pay_date.'"')
+ ->andWhere('pay_t.status_id=7')
+ ->count();
+
+
+ $company_items = CompanyT::find()->all();
+
+ return $this->render('pay-list',[
+ 'group_items' => $group_items,
+ 'items' => $items,
+ 'page_info' => $page_info,
+ 'page' => $page,
+ 'username' => $username,
+ 'name' => $name,
+ 'pay_date' => $pay_date,
+ 'group_id' => $group_id,
+ 'company_id' => $company_id,
+ 'status_id' => $status_id,
+ 'is_leave' => $is_leave,
+ 'company_items' => $company_items,
+
+ 'return_count' => $return_count
+ ]);
}
/**
@@ -116,7 +133,7 @@ class PersonnelController extends \frontend\controllers\UserBaseController
if($user_info->is_double == 1) {
$day_num = $work_day ? $work_day->double_break : '0';
}else{
- $day_num = $work_day ? $work_day->single_break : '0';
+ $day_num = $work_day ? $work_day->single_break : '0';
}
if($day_num == '0'){
@@ -131,8 +148,8 @@ class PersonnelController extends \frontend\controllers\UserBaseController
$try_pay = $user_info->worktype?round(($pay_info->try_pay) / $day_num, 2):'0';
$true_pay = $user_info->worktype?round(($pay_info->formal_pay) / $day_num, 2):'0';
}else{
- $try_pay = $user_info->worktype?round(($user_info->try_pay) / $day_num, 2):'0';
- $true_pay = $user_info->worktype?round(($group_info?($group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay):$user_info->ext_pay) / $day_num, 2):'0';
+ $try_pay = $user_info->worktype?round(($user_info->try_pay) / $day_num, 2):'0';
+ $true_pay = $user_info->worktype?round(($group_info?($group_info->base_pay + $group_info->job_pay + $group_info->station_pay + $user_info->ext_pay):$user_info->ext_pay) / $day_num, 2):'0';
}
@@ -158,10 +175,13 @@ class PersonnelController extends \frontend\controllers\UserBaseController
} else {
$pay_info->should_pay = floatval($user_info->ext_pay);
}
+
if(!$pay_info->save()) {
var_dump($pay_info->errors);
exit;
}
+ $pay_info = PayT::findOne(['user_id'=>$user_id,'pay_date'=>$pay_date]);
+// die;
}
return $this->render('pay-info',[
@@ -205,18 +225,28 @@ class PersonnelController extends \frontend\controllers\UserBaseController
$electricity_pay = $request->post('electricity_pay',0);
$deposit = $request->post('deposit',0);
$public_pay = $request->post('public_pay',0);
+ $extjob_days = $request->post('extjob_days',0);
$attendance_days = $request->post('attendance_days');
$try_attendance_days = $request->post('try_attendance_days');
$try_extjob_pay = $request->post('try_extjob_pay');
$give_social_pay = $request->post('give_social_pay');
$full_attendance_pay = $request->post('full_attendance_pay');
$pass_time_pay = $request->post('pass_time_pay');
- $formulae = $request->post('formulae');
+// $formulae = $request->post('formulae');
$get_full_attendance_pay = $request->post('get_full_attendance_pay', 0);
$get_pass_time_pay = $request->post('get_pass_time_pay', 0);
$try_pay = $request->post('try_pay', 0);
$formal_pay = $request->post('formal_pay', 0);
+
+
+ $calls = $request->post('calls', 0);
+ $bus = $request->post('bus', 0);
+ $bonus = $request->post('bonus', 0);
+ $turnover = $request->post('turnover', 0);
+ $tax = $request->post('tax', 0);
+
+
$pay_info = PayT::findOne(['id'=>$id]);
if($pay_info) {
$pay_info->assessment_pay = $assessment_pay;
@@ -235,22 +265,33 @@ class PersonnelController extends \frontend\controllers\UserBaseController
$pay_info->electricity_pay = $electricity_pay;
$pay_info->deposit = $deposit;
$pay_info->public_pay = $public_pay;
+ $pay_info->extjob_days = $extjob_days;
$pay_info->attendance_days = $attendance_days;
$pay_info->try_attendance_days = $try_attendance_days;
$pay_info->try_extjob_pay = $try_extjob_pay;
$pay_info->give_social_pay = $give_social_pay;
$pay_info->full_attendance_pay = $full_attendance_pay;
$pay_info->pass_time_pay = $pass_time_pay;
- $pay_info->formulae = $formulae;
+// $pay_info->formulae = $formulae;
$pay_info->get_full_attendance_pay = $get_full_attendance_pay;
$pay_info->get_pass_time_pay = $get_pass_time_pay;
$pay_info->try_pay = $try_pay;
$pay_info->formal_pay = $formal_pay;
+
+
+ $pay_info->calls = $calls;
+ $pay_info->bus = $bus;
+ $pay_info->bonus = $bonus;
+ $pay_info->turnover = $turnover;
+ $pay_info->tax = $tax;
+ $pay_info->renshi_status_id = 1;
+ $pay_info->status_id = $pay_info->chuna_status_id + 1;
+
$pay_info->save();
$pay_info->calPay();
- $content = $this->my->showName.'修改了本条记录'.$pay_info->pay_date.'工资';
- $this->addUserLog($pay_info->user_id, $content);
+ $content = '人事:'.$this->my->showName.'提交'.$pay_info->pay_date.'工资';
+ $this->addUserLog($pay_info->id, $content);
$result['success'] = true;
$result['msg'] = '保存成功';
@@ -413,4 +454,42 @@ class PersonnelController extends \frontend\controllers\UserBaseController
$result['files'][0]['error'] = '上传文件失败';
return json_encode($result);
}
+
+
+ public function actionAjaxHistoryIndex()
+ {
+ Yii::$app->response->format = Response::FORMAT_JSON;
+ $request = Yii::$app->request;
+ $pay_id = $request->get('pay_id');
+ $page = $request->get('page',1);
+
+ $result = array();
+ $result['success'] = false;
+ $result['msg'] = '读取失败';
+
+ $query = UserLogT::find()
+ ->where(['pay_id'=>$pay_id])
+// ->andWhere('op_time>='.strtotime("-6 months"))
+ ->orderBy('id DESC');
+
+ $total = $query->count();
+
+ $pagination = new Pagination(['totalCount' => $total,'pageSize'=>20]);
+ $pagination->setPage($page-1);
+
+ $query = $query->offset($pagination->offset)->limit($pagination->limit);
+ $items = $query->all();
+
+ $page_info = MyLib::getAjaxPageInfo($pagination,'car_history_list');
+ $html = $this->renderPartial('ajax-history-index',[
+ 'pay_id' => $pay_id,
+ 'items' => $items,
+ 'page' => $page,
+ 'page_info' => $page_info
+ ]);
+ $result['success'] = true;
+ $result['msg'] = '读取成功';
+ $result['html'] = $html;
+ return $result;
+ }
}
\ No newline at end of file
diff --git a/frontend/views/finance/budian-list.php b/frontend/views/finance/budian-list.php
new file mode 100644
index 0000000..84e432c
--- /dev/null
+++ b/frontend/views/finance/budian-list.php
@@ -0,0 +1,184 @@
+
+
+
+
+
+
+
+
+
+ 序号 |
+ 车牌号 |
+ 被保险人 |
+ 保险公司 |
+ 保单号 |
+ 出单日期 |
+ 商业净保费 |
+ 保险类型 |
+ 补点比例 |
+ 补点金额 |
+
+ $item) {
+ $start_index = $index;
+
+
+ $total_real = $item->total * $item->total_rate/100;
+ $total_clear_real = $item->total_clear * $item->total_rate/100;
+ $total_dis = round($total_clear_real - $item->r_total,2);
+
+ $order_caiwu_info = $item->orderCaiwu;
+ $order_info = $item->order;
+ $car_info = $order_info->car;
+
+ ?>
+
+ =$start_index+1?> |
+ =$item->car_no?> |
+ =$item->id_man?> |
+ =$order_info && $order_info->company ? $order_info->company->name:''?> |
+ =$item->insurer_no?> |
+ =$order_info ? $order_info->print_date : ''?> |
+ =$item->total_clear?> |
+ =$item->insurer_type == 1?'商业':'交强'?> |
+ =$item->budian_rate?> |
+ =$item->budian_money?> |
+
+
+
+ 合计 |
+ |
+ |
+ |
+ |
+ |
+ =$total1_clear_all?> |
+ |
+ |
+ =$total_money_all?> |
+
+
+ =$page_info?> |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/views/finance/chuna-gongzi-info.php b/frontend/views/finance/chuna-gongzi-info.php
new file mode 100644
index 0000000..91007ab
--- /dev/null
+++ b/frontend/views/finance/chuna-gongzi-info.php
@@ -0,0 +1,769 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/views/finance/chuna-gongzi-list.php b/frontend/views/finance/chuna-gongzi-list.php
new file mode 100644
index 0000000..eba8793
--- /dev/null
+++ b/frontend/views/finance/chuna-gongzi-list.php
@@ -0,0 +1,155 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 工号 |
+ 真实姓名 |
+ 工资月份 |
+ 所属岗位 |
+ 提成工资 |
+ 状态 |
+ 操作 |
+
+
+
+ |
+ |
+ |
+ |
+ =number_format($total_real_pay,2)?> |
+ |
+ |
+
+
+ =$page_info?> |
+
+
diff --git a/frontend/views/finance/gongzi-all-info.php b/frontend/views/finance/gongzi-all-info.php
new file mode 100644
index 0000000..079bff4
--- /dev/null
+++ b/frontend/views/finance/gongzi-all-info.php
@@ -0,0 +1,724 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/views/finance/gongzi-all-list.php b/frontend/views/finance/gongzi-all-list.php
new file mode 100644
index 0000000..cca18ce
--- /dev/null
+++ b/frontend/views/finance/gongzi-all-list.php
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 工号 |
+ 真实姓名 |
+ 工资月份 |
+ 所属岗位 |
+
+ 基本工资 |
+ 提成工资 |
+ 状态 |
+ 操作 |
+
+
+
+ |
+ |
+ |
+ |
+ |
+ =number_format($total_real_pay,2)?> |
+ |
+
+
+ =$page_info?> |
+
+
diff --git a/frontend/views/finance/pay2-info.php b/frontend/views/finance/pay2-info.php
index 37a6ae2..7852fab 100644
--- a/frontend/views/finance/pay2-info.php
+++ b/frontend/views/finance/pay2-info.php
@@ -1,118 +1,154 @@
+