Commit 612783c0 by 朱继来

调整导入报价

parent 007a384f
Showing with 9 additions and 2 deletions
......@@ -184,6 +184,8 @@ class QuoteModel extends Model
}
$list = $list->whereNotIn('q.status', [0, -1]); // 过滤报价草稿
} elseif ($type == 3) {
$list = $list->where('q.status', 0)->whereIn('q.inquiry_items_id', explode(',', $input['inquiry_items_ids']));
} elseif (@$input['inquiry_items_id'] > 0) {
$list = $list->whereNotIn('q.status', [0, -1])->where('q.inquiry_items_id', $input['inquiry_items_id']);
} elseif (isset($input['inquiry_items_ids']) && $input['inquiry_items_ids']) {
......@@ -197,7 +199,12 @@ class QuoteModel extends Model
}
$list = $list->select($field)->orderBy('id', 'desc');
// dump($list->getBindings());
// dump($list->toSql());
// $tmp = str_replace('?', '"'.'%s'.'"', $list->toSql());
// $tmp = vsprintf($tmp, $list->getBindings());
// echo $tmp;
// exit;
if ($export) {
$list = $list->get()->toArray();
......@@ -333,7 +340,7 @@ class QuoteModel extends Model
{
$list = $this->from('quote as q')->join('inquiry_items as it', 'q.inquiry_items_id', '=', 'it.id');
if (isset($input['type']) && $input['type'] == 4) {
if (isset($type) && $type == 4) {
$list = $list->leftJoin('inquiry as i', 'it.inquiry_id', '=', 'i.id');
$perm = new PermController;
......
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