Commit 261ac9f2 by 连敬荣

代码重构

parent 7d2761e2
......@@ -6,4 +6,5 @@ Route::Get('/ApiBrandList','SearchController@getBrandList');//新增询价查询
Route::Post('/ApiCheckGoods','SearchController@checkUniqueGoods');//检查是否已经存在询价单;
Route::Post('/ApiCreateOneItems','DataController@createInquiryItemsDetail');//创建一条询价明细;
Route::Post('/api/ApiDeleteInquiryItems','DataController@deleteInquiryItemsDetail');//删除询价明细;
//Route::Post('/api/ApiEditInquiry','DataController@ApiEditInquiry');//新增询价;
\ No newline at end of file
Route::Post('/api/ApiEditInquiry','DataController@creatInquiry');//新增询价;
Route::Post('/ApiUpdateOneItems','DataController@editInquiryItemDetail');//修改单条明细记录;
\ No newline at end of file
......@@ -68,6 +68,15 @@ class InquiryItemsAssignModel extends Model
return $this->where($map)->delete();
}
public function clearOutAssign($inquiry_items_id){//清空指定人
$this->where("inquiry_items_id",$inquiry_items_id)->delete();
}
public function insertAssign($assignInsert){//插入指定人
$this->insert($assignInsert);
}
public function getAssignInfo($inquiry_items_id){
$assignInfo = $this->select("assign_uid")->where("inquiry_items_id",$inquiry_items_id)->get();
return $assignInfo;
}
}
\ No newline at end of file
......@@ -665,4 +665,20 @@ class InquiryItemsModel extends Model
public function updateInquiryItemsStatus($inquiryItemsId,$status){
$this->where('id', $inquiryItemsId)->update(['status' => $status]); // 存在指定采购,则标记状态为已领取
}
public function hasItems($inquiry_id){//判断是否存在明细
$hasItems = $this->where("inquiry_id",$inquiry_id)->count();
return $hasItems;
}
public function getInquiryItems($inquiry_id){
$inquiry_items = (new InquiryItemsModel())->where("inquiry_id",$inquiry_id)->get()->toArray();
return $inquiry_items;
}
public function updateInquiryItemsDetail($inquiry_items_id,$updateArr){
$this->where("id",$inquiry_items_id)->update($updateArr);
}
public function getItemArr($inquiry_items_id){
$itemArr = $this->where("id",$inquiry_items_id)->first()->toArray(); #明细
return $itemArr;
}
}
\ No newline at end of file
......@@ -236,5 +236,8 @@ class InquiryItemsReportModel extends Model
return $check != count($itemsIdArr) ? [1001,$types == 1 ? "存在没选中的询价单!":"存在没确定的询价单!"] : [0,"通过"];
}
public function updateIquiryItemsReport($item,$reportArr){
$this->where("inquiry_items_id", $item['id'])->update($reportArr);
}
}
\ No newline at end of file
......@@ -571,6 +571,9 @@ class InquiryModel extends Model
$res = $con->select($sql1);
return @$res[0]["count"];
}
public function getMainArr($itemArr){//获取主表单状态
$mainArr = $this->where("id",$itemArr["inquiry_id"])->first()->toArray();
return $mainArr;
}
}
\ No newline at end of file
......@@ -20,5 +20,13 @@ class InquiryUsersModel extends Model
protected $primaryKey='id';
public $timestamps = false;
public function getUserInfo($input,$user){
$userInfo= (new InquiryUsersModel())->where(["create_uid" => $input["user_id"], "user_name" => $user[0]["name"]])->first();
return $userInfo;
}
public function getUserId($input,$user){
$userId = $this->insertGetId(["create_uid" => $input["user_id"], "user_name" => $user[0]["name"], "create_time" => time()]);
return $userId;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment