|
@@ -302,6 +302,11 @@ class Purchin extends Base
|
|
|
];
|
|
|
Db::startTrans();
|
|
|
try{
|
|
|
+
|
|
|
+ //如果开通了供应商账号,则只允许level3账号操作,level2账号不允许操作
|
|
|
+ $all_has_supplier_account = checkHasAccountBySupplierNos([$cgdinfo['supplierNo']]);
|
|
|
+ if (isset($all_has_supplier_account['data'][$cgdinfo['supplierNo']]) && $this->level == 2) throw new Exception('已开通供应商账号,当前账号不能操作');
|
|
|
+
|
|
|
$win = Db::name("purchease_in")->insert($orin,true);
|
|
|
if($win){
|
|
|
$sto = ["order_code"=>$wsm_in_code,"status"=>$status,"action_remark"=>'',"action_type"=>"edit"];
|
|
@@ -357,14 +362,14 @@ class Purchin extends Base
|
|
|
// if ($this->uid != $personid) throw new Exception('只能由供应商负责人操作');
|
|
|
// }
|
|
|
|
|
|
- if ($this->level == 2) {
|
|
|
- $person = Db::connect('mysql_sys')
|
|
|
- ->name('supplier')
|
|
|
- ->where('code', $cgdinfo['supplierNo'])
|
|
|
- ->field('person,personid')
|
|
|
- ->findOrEmpty();
|
|
|
- if ($this->uid != $person['personid']) throw new Exception('只能由供应商负责人操作');
|
|
|
- }
|
|
|
+// if ($this->level == 2) {
|
|
|
+// $person = Db::connect('mysql_sys')
|
|
|
+// ->name('supplier')
|
|
|
+// ->where('code', $cgdinfo['supplierNo'])
|
|
|
+// ->field('person,personid')
|
|
|
+// ->findOrEmpty();
|
|
|
+// if ($this->uid != $person['personid']) throw new Exception('只能由供应商负责人操作');
|
|
|
+// }
|
|
|
|
|
|
if($status==1){
|
|
|
Db::commit();
|