修改创建档案
This commit is contained in:
parent
b2869c5ed5
commit
7c264c1170
@ -16,7 +16,7 @@ class InformationController extends BaseApiController
|
||||
if ($res != true) {
|
||||
return $this->fail( BaseLogic::getError());
|
||||
}
|
||||
return $this->success('成功', $res->toArray());
|
||||
return $this->success('ok', $res->toArray());
|
||||
}
|
||||
|
||||
public function add()
|
||||
|
@ -53,11 +53,14 @@ class UserInformationg extends BaseModel
|
||||
Db::startTrans();
|
||||
try{
|
||||
$result = self::create($data);
|
||||
switch($param['data_type']){
|
||||
case 1:
|
||||
self::informationg_demand($param,$result['id']);
|
||||
break;
|
||||
foreach($param['datas'] as $k=>$v){
|
||||
self::informationg_demand($v,$result['id'],$param['admin_id']);
|
||||
}
|
||||
// switch($param['data_type']){
|
||||
// case 1:
|
||||
// self::informationg_demand($param,$result['id']);
|
||||
// break;
|
||||
// }
|
||||
Db::commit();
|
||||
}catch(\Exception $e){
|
||||
Db::rollback();
|
||||
@ -67,10 +70,10 @@ class UserInformationg extends BaseModel
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function informationg_demand($param,$id){
|
||||
public static function informationg_demand($param,$id,$admin_id){
|
||||
|
||||
$data=[
|
||||
'create_user_id'=>$param['admin_id'],
|
||||
'create_user_id'=>$admin_id,
|
||||
'category_id'=>$param['category_id']??0,
|
||||
'category_child'=>$param['category_child']??0,
|
||||
'data'=>json_encode($param['datas']),
|
||||
|
Loading…
x
Reference in New Issue
Block a user