Browse Source

Merge branch 'dev' of wugg/cxinv into master

wugg 2 years ago
parent
commit
67193f25f3

+ 2 - 1
app/admin/controller/Payment.php

@@ -491,7 +491,8 @@ class Payment extends BaseController
            return error_show(1004,"未能找到对应采购单数据");
        }
        if($status==4){
-       	    $stages = Db::name("pay_payment")->where(['status'=>[0,1,2,3],"payNo"=>$payNo,"is_del"=>0])->findOrEmpty();
+       	    $stages = Db::name("pay_payment")->where(['status'=>[0,1,2,3,4],"payNo"=>$payNo,"is_del"=>0])
+       	    ->findOrEmpty();
        	    if(!empty($stages)) return error_show(1004,"对账单存在未解除的付款申请单");
        	    $hpinv = Db::name("pay_invoice")->where(['status'=>[0,1,2,3,4,9],"payNo"=>$payNo,"is_del"=>0])->findOrEmpty();
        	    if(!empty($hpinv)) return error_show(1004,"对账单存在未解除的回票申请单");

+ 40 - 0
app/admin/controller/User.php

@@ -610,6 +610,46 @@ class User extends BaseController{
 		 return $post['id']==""?app_show(0,"账户新建成功"):app_show(0,"账户编辑成功");
 	}
 
+    //添加超管账号
+    public function adminAccountAdd()
+    {
+
+        $post = $this->request->only(['nickname', 'mobile', 'email' => '', 'relaComNo' => ''], 'post', 'trim');
+        $validate = Validate::rule([
+            'nickname|真实姓名' => 'require|min:2|max:200',
+            'mobile|手机号' => 'require|mobile',
+            'email|邮箱' => 'email|max:255',
+            'companyArr|关联账户' => 'array|max:100',
+        ]);
+        if ($validate->check($post) == false) return error_show(1004, $validate->getError());
+
+        $post['companyArr'][] = [
+            "companyCode" => '',
+            "companyName" => '',
+            "company_type" => 0,
+            "is_main" => 1,
+        ];
+
+        $rs = add_admin_acount($post);
+        if (!isset($rs['code']) || $rs['code'] != 0) return error_show(1004, $rs['message']);
+
+        $up = Db::name("user_role")->insert([
+            "uid" => $rs['data']["userid"],
+            "nickname" => $rs['data']["nickname"],
+            "roleid" => 1,
+            "companyNo" => '',
+            "company_type" => '',
+            "status" => 1,
+            "is_main" => 1,
+            "is_del" => 0,
+            "addtime" => date("Y-m-d H:i:s"),
+            "updatetime" => date("Y-m-d H:i:s"),
+        ]);
+        if ($up == false) return error_show(1004, '超管账户分配角色失败');
+
+        return app_show(0, '添加超管账号成功');
+    }
+
 
 
 }

+ 1 - 0
app/admin/route/app.php

@@ -30,6 +30,7 @@ Route::rule('setpwd', 'admin/User/setPwd');
 Route::rule('setstatus', 'admin/User/setStatus');
 Route::rule('setcompanystatus', 'admin/User/setCompanyStatus');
 Route::rule('getcompany', 'admin/User/GetCompany');
+Route::rule('adminAccountAdd', 'admin/User/adminAccountAdd');
 
 Route::rule('rolelist', 'admin/Role/roleList');
 Route::rule('roleall', 'admin/Role/roleAll');

+ 2 - 2
app/command/Report.php

@@ -103,7 +103,7 @@ class Report extends Command
 
 		if($method=='')  $output->writeln("[$date]【{$param['name']}】[{$param['apply_name']}]预约记录处理失败");
 		$data =$this->$method($param);
-		$url=excelSaveFile($data,$file);
+            $url = excelSaveFile($data, $file . date('_YmdHis'));//加时间戳,防止同名文件覆盖
 		 Db::name('exec_log')
                     ->where(['id' => $param['id'], 'status' => 4])//status==1 待处理
                     ->update([
@@ -501,7 +501,7 @@ class Report extends Command
             b.sendType 发货方式,
             a.thNum 退货数量,
             a.fundCode 财务核算编码')
-		          ->leftJoin('cgd_info b', 'b.qrdCode=a.sequenceNo and b.is_del=0')
+		          ->leftJoin('cgd_info b', 'b.sequenceNo=a.cgdNo and b.is_del=0')
 		          ->where($where)
 		          ->order(['a.id' => 'desc'])
 		          ->cursor();

+ 14 - 0
app/common.php

@@ -248,6 +248,20 @@ function addacount($condition){
 
     return json_decode($response,true);
 }
+
+//添加超管账号
+if(function_exists('add_admin_account') == false){
+    function add_admin_acount(array $data=[]){
+        $host = Config::get("app");
+
+        $url = $host["api_host"]."/add_admin_account";
+        $response=curl_request($url,$data);
+
+        return json_decode($response,true);
+    }
+}
+
+
 if(!function_exists("headerSign")){
 
 	function headerSign($post){