Commit 4fef11e5 by hcy001

1

parent a6b389f1
...@@ -30,8 +30,9 @@ class CommonModel extends Model ...@@ -30,8 +30,9 @@ class CommonModel extends Model
//搜索自己的客户 //搜索自己的客户
public function getMyUser($create_uid,$k) public function getMyUser($create_uid,$k)
{ {
$where = $k ? "and user_name like '%".$k."%'":"";
$dbspu = DB::connection("rfq"); $dbspu = DB::connection("rfq");
$brandInfo = $dbspu->select("select id value,user_name name from lie_inquiry_users where create_uid = $create_uid and user_name like '".$k."%' limit 10"); $brandInfo = $dbspu->select("select id value,user_name name from lie_inquiry_users where create_uid = $create_uid $where limit 10");
if (count($brandInfo) == 0){ if (count($brandInfo) == 0){
$brandInfo = [["value"=>0,"name"=>$k]]; $brandInfo = [["value"=>0,"name"=>$k]];
} }
......
...@@ -185,7 +185,7 @@ class InquiryItemsModel extends Model ...@@ -185,7 +185,7 @@ class InquiryItemsModel extends Model
return [1001,"插入数据不得为空"]; return [1001,"插入数据不得为空"];
} }
if (empty($b["inquiry_id"])) return [1003, "询价单ID不得为空"]; if (empty($b["inquiry_id"])) return [1003, "询价单ID不得为空"];
if (empty($b["brand_s"])) return [1003, "请选择型号名称"]; if (empty($b["brand_s"])) return [1003, "请选择品牌名称名称"];
if (empty($b["inquiry_number"])) return [1003, "请输入询价数量"]; if (empty($b["inquiry_number"])) return [1003, "请输入询价数量"];
if (empty($b["batch"])) return [1003, "请输入批次要求"]; if (empty($b["batch"])) return [1003, "请输入批次要求"];
if (empty($b["delivery_time"])) return [1003, "请选择交货日期"]; if (empty($b["delivery_time"])) return [1003, "请选择交货日期"];
......
...@@ -54,7 +54,7 @@ class InquiryModel extends Model ...@@ -54,7 +54,7 @@ class InquiryModel extends Model
break; break;
case "goods_name": case "goods_name":
case "brand_name": case "brand_name":
$query->whereRaw('lie_b.'.$k.' like "' . $v . '%" '); $query->whereRaw('lie_b.'.$k.' like "%' . $v . '%" ');
break; break;
case "customer_name": case "customer_name":
$query->whereRaw('lie_a.user_name like "' . $v . '%" '); $query->whereRaw('lie_a.user_name like "' . $v . '%" ');
......
...@@ -19,7 +19,7 @@ layui.config({ ...@@ -19,7 +19,7 @@ layui.config({
data:$("#sku_init").val() == "" ? []:JSON.parse($("#sku_init").val()) , data:$("#sku_init").val() == "" ? []:JSON.parse($("#sku_init").val()) ,
remoteMethod: function(val, cb, show){ remoteMethod: function(val, cb, show){
//这里如果val为空, 则不触发搜索 //这里如果val为空, 则不触发搜索
if(!val){ if(!val || val.length <3 ){
return cb([]); return cb([]);
} }
$.ajax({ $.ajax({
...@@ -40,9 +40,7 @@ layui.config({ ...@@ -40,9 +40,7 @@ layui.config({
} }
,on: function (data) { ,on: function (data) {
var arr = data.arr var arr = data.arr
if (arr.length == 0){ if (arr.length > 0){
console.log("数组为空")
}else {
console.log(data.arr[0].name) console.log(data.arr[0].name)
$("#sku_s").val(data.arr[0].name); $("#sku_s").val(data.arr[0].name);
} }
......
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