Commit 9a1ddb07 by 杜文军

交货时间

parent 7871cdae
......@@ -43,6 +43,14 @@ class InquiryItemsAssignModel extends Model
->toArray();
}
public function GetAssignCountByInquiryId($inquiry_items_id)
{
return $this
->where("inquiry_items_id", $inquiry_items_id)
->count();
}
// 删除
public function delAssign($inquiry_items_id, $assign_uid, $types=1)
{
......
......@@ -248,7 +248,6 @@ class InquiryModel extends Model
->join('inquiry_items_urge as u', 'b.id', '=', 'u.inquiry_items_id')
->where('c.assign_uid', $user_id);
}
$list = $list->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.user_name,lie_a.com_name,lie_a.create_name,lie_a.create_time as inquiry_ctime, lie_b.*, lie_c.id as c_id, lie_c.assign_type as c_assign_type"))
->where(function ($query) use ($input, $type, $user_id) {
foreach ($input as $k => $v) {
......@@ -312,7 +311,6 @@ class InquiryModel extends Model
// $tmp = vsprintf($tmp, $list->getBindings());
// echo $tmp;
// exit;
$page = isset($input['p']) ? $input['p'] : $input['page'];
$list = $list->orderBy('b.id', 'desc')->paginate(@$input['limit'] ? $input["limit"] : 10, ['*'], 'p', @$page ? $page : 1)->toArray();
......@@ -320,6 +318,8 @@ class InquiryModel extends Model
$QuoteModel = new QuoteModel();
$InquiryItemsUrgeModel = new InquiryItemsUrgeModel;
$InquiryItemsAssignModel = new InquiryItemsAssignModel;
foreach ($list['data'] as $k => &$v) {
//报价
......@@ -355,6 +355,9 @@ class InquiryModel extends Model
}
}
$v['assign_count'] = $InquiryItemsAssignModel->GetAssignCountByInquiryId($v['id']);
$v['delivery_time'] = $v['delivery_time'] > 6 ? ($v['delivery_time']/7).'周' : $v['delivery_time']."天";
}
return [0, '成功', $list['data'], $list['total']];
......
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