where($condition) ->paginate(10); return $result; } public function getFartherList() { $result = $this ->where(['product_pid' => 0]) ->select(); return $result; } public function findProduct($condition) { $result = $this ->where($condition) ->find(); return $result; } public function updateProduct($id, $data) { $result = $this ->where(['product_id' => $id]) ->update($data); return $result; } public function addProduct($data) { $result = $this ->insert($data); return $result; } public function deleteProduct($condition) { $result = $this ->where($condition) ->delete(); return $result; } }