Commit 4fef11e5 by hcy001

1

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