Zhouzhendong пре 5 година
родитељ
комит
a306e7638e

+ 6 - 3
resources/views/customer/customer/index.blade.php

@@ -344,14 +344,17 @@
                     let val = $("#ownerSelectpicker").selectpicker('val');
                     let id = this.customers[this.index]['id'];
                     if (val.length>0){
-                        let errors = "";
+                        let error = "";
                         this.owners.forEach(owner=>{
                             val.forEach(v=>{
-                                if (v===owner.id&&(owner.customer_id && owner.customer_id!==id)){}
+                                if (v===owner.id&&(owner.customer_id && owner.customer_id!==id)){
+                                    error += owner.name+",";
+                                }
                             });
                         });
+                        if (error)error += "已绑定其他客户";
                     }
-                    console.log(val);
+                    console.log(error);
                 }
             },
             filters:{

+ 1 - 1
tests/Services/CustomerService/CustomerTest.php

@@ -46,7 +46,7 @@ class CustomerTest extends TestCase
      * @group customer
      */
     public function testPaginate(){
-        $models = $this->service->paginate(5);
+        $models = $this->service->paginate(["paginate"=>5]);
         $this->assertGreaterThanOrEqual(1,count($models));
         $this->assertLessThanOrEqual(5,count($models));
     }