|
|
|
@ -34,21 +34,36 @@ class VerifyBillController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
public function index(){
|
|
|
|
|
$m_title = '对账单管理';
|
|
|
|
|
$l = $this->companyinfo;
|
|
|
|
|
$list_data = [];
|
|
|
|
|
$field = "id,company_name,withdraw_type,company_name,company_belong,statement_begin_time,statement_end_time,statement_money,platform_amount,confirm_status,confirm_log,op_time";
|
|
|
|
|
if(isset($l['promote_company_id'])){
|
|
|
|
|
$map = [
|
|
|
|
|
"company_id"=>$this->companyinfo['company_id'],
|
|
|
|
|
"verify_status"=>['GT',1],
|
|
|
|
|
"company_id"=>["in",$l['promote_company_id']],
|
|
|
|
|
"confirm_status"=>['NEQ',0],
|
|
|
|
|
"company_belong"=>['NEQ',9]
|
|
|
|
|
];
|
|
|
|
|
if($this->companyinfo['company_type'] == 'cp'){
|
|
|
|
|
$map['company_belong'] = 9;
|
|
|
|
|
}else{
|
|
|
|
|
$map['company_belong'] = ['NEQ',9];
|
|
|
|
|
$list_data = DM('company_statement')
|
|
|
|
|
->field($field)
|
|
|
|
|
->where($map)
|
|
|
|
|
->order('op_time desc')
|
|
|
|
|
->select();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$list_data = DM('company_statement')
|
|
|
|
|
->field("id,withdraw_type,company_name,company_belong,statement_begin_time,statement_end_time,statement_money,platform_amount,verify_status,verify_log,op_time")
|
|
|
|
|
if(isset($l['partner_id'])){
|
|
|
|
|
$map = [
|
|
|
|
|
"company_id"=>["in",$l['partner_id']],
|
|
|
|
|
"confirm_status"=>['NEQ',0],
|
|
|
|
|
"company_belong"=>9
|
|
|
|
|
];
|
|
|
|
|
$partner_data = DM('company_statement')
|
|
|
|
|
->field($field)
|
|
|
|
|
->where($map)
|
|
|
|
|
->order('op_time desc')
|
|
|
|
|
->select();
|
|
|
|
|
|
|
|
|
|
$list_data = array_merge($list_data,$partner_data);
|
|
|
|
|
}
|
|
|
|
|
foreach ($list_data as $k => &$v) {
|
|
|
|
|
$v['statement_begin_time'] = date('Y-m-d',$v['statement_begin_time']);
|
|
|
|
|
$v['statement_end_time'] = date('Y-m-d',$v['statement_end_time']);
|
|
|
|
@ -56,10 +71,11 @@ class VerifyBillController extends Controller {
|
|
|
|
|
$v["valid"] = "{$v['statement_begin_time']} ~ {$v['statement_end_time']}";
|
|
|
|
|
$v['withdraw_type_1'] = ($v['withdraw_type'] == 1 ? "月结" :"周结");
|
|
|
|
|
$v['withdraw_type_2'] = ($v['withdraw_type'] == 2 ? "补点" :"正常结算");
|
|
|
|
|
if ($v['verify_status'] == 2) {
|
|
|
|
|
|
|
|
|
|
if ($v['confirm_status'] == 1) {
|
|
|
|
|
$v['verify_status_str'] = '未确认';
|
|
|
|
|
}
|
|
|
|
|
if ($v['verify_status'] > 2) {
|
|
|
|
|
if ($v['confirm_status'] == 2) {
|
|
|
|
|
$v['verify_status_str'] = '已确认';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -116,21 +132,24 @@ class VerifyBillController extends Controller {
|
|
|
|
|
{
|
|
|
|
|
if(!isset($_REQUEST['id'])) $this->error("参数错误");
|
|
|
|
|
$id = $_REQUEST['id'];
|
|
|
|
|
|
|
|
|
|
$dbres = M("CompanyStatement","tab_")->field("id,verify_status,verify_log")->where("id='{$id}'")->find();
|
|
|
|
|
if($dbres['verify_status'] != 2) return;
|
|
|
|
|
$dbres['verify_log'] = json_decode($dbres['verify_log'],true);
|
|
|
|
|
$dbres['verify_log']['confirm_user']=$this->companyinfo['mobile_phone'];
|
|
|
|
|
$dbres['verify_log']['confirm_time']=date("Y-m-d H:i:s");
|
|
|
|
|
$dbres['verify_log'] = json_encode($dbres['verify_log']);
|
|
|
|
|
$dbres['verify_status']=3;
|
|
|
|
|
$dbres = M("CompanyStatement","tab_")->field("id,confirm_status,confirm_log")->where("id='{$id}'")->find();
|
|
|
|
|
if($dbres['confirm_status'] != 1){
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 0,
|
|
|
|
|
"info"=>"已确认"
|
|
|
|
|
));
|
|
|
|
|
};
|
|
|
|
|
$dbres['confirm_log'] = json_decode($dbres['confirm_log'],true);
|
|
|
|
|
$dbres['confirm_log']['confirm_user']=$this->companyinfo['mobile_phone'];
|
|
|
|
|
$dbres['confirm_log']['confirm_time']=date("Y-m-d H:i:s");
|
|
|
|
|
$dbres['confirm_log'] = json_encode($dbres['confirm_log']);
|
|
|
|
|
$dbres['confirm_status']=2;
|
|
|
|
|
M("CompanyStatement","tab_")->save($dbres);
|
|
|
|
|
$this->ajaxReturn(array(
|
|
|
|
|
'status' => 1,
|
|
|
|
|
"info"=>"操作成功"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*导出excell
|
|
|
|
|
* @param int id
|
|
|
|
|